Fixed bug where Long is incorrectly cast