Some fixes for AppEngine issues