Fix call to getcwd() for GNU compatibility.
Bump version to 1.0.4.