Edited error handling to check edge cases of passwords. Cleaned up code in switch statements to be less redundant.