'Fix Linux compatibility bugs - Clean up code'