lubosz' changes for Linux build

Lost the pull request when merging branches