Remove cast warnings