Fixed MacOS compatibility