Fix login.php redirect loop

Closes #4