Fixed bus error on osx