Rolled back some coverity issue fixes for mac build