Changes for unix

Fixed several bugs that unix didn't like