Fixing small bugs on darwin