Fixed Linux/OSX crash