fixed C style cast warnings