Changes to make it work with GAE