linux fixes and cleanup