Corrected problem due to different ways to handle dirname() errors on CygWin/Linux bash