Chris's patch
password bug fix
segfault on error fix