Backported two small bug fixes to 2.2 branch git-svn-id: svn://192.168.202.10@1443 3d104415-ff17-0410-8863-d5cf3c621b8a