Fix script to properly handle on Linux