Mostly fixed issues in Linux specific code