Bug fixes for running on the real app engine