Fixes for Flask-Login