Updated for actual OS builds.
removing cast warnings