Fixed (int) casting problem with Fabios's refactoring