Fixed cast warnings