Fixed compatibility issues with non-GNU systems