Fixed an issue with int casting