Fixes security issues which allow bypassing authentication