Fix false positive for invalid credentials

Fix for issue #1.