some fixes to run on GAE