Error checks for Linux and OSX