Fixed authinication crashes and SQLi possbility