Fixed some issues with CSRF tokens