Added explicit cast to int to fix warning