Set timeouts properly

This is needed to work on app engine.