unix cast fixes