Fixed a missing cast