Cast cruft in order to support Apple gcc