Properly handle passwords that are whitespace

Thanks @zbunde for the find