Cherry picking r9614 and r9620 into releases/2.2 5917 and 5916. git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/2.2@9625 8db76d5a-ed1c-0410-87a9-c151d255dfc7