Fixed a casting mistake.