Windows and linux fixes