Updated logging and fixed bug with CSRF