Changes to make it work on Unix systems