Fixing small UNIX and MacOS Bugs