Fixes to work on Google App Engine