resolved compile-time cast warnings