Fixed some code errors in bottle.py

Should consider just upgrading our version.
PEP8 cleanup of app.py