fix a few issues that worked locally, but failed on google app engine