Fixed a type error through explicit cast to int.