Some linux fixes and log cleanup