fix redundant cast compiler warnings