Remove some redundant casts on OSX