[TASK] Cast to int instead of using intval

An (int) cast provides better performance than an intval() call.

Closes #128