Make sure toInt is defined before calling it -- Related to #1934
Merge branch 'v1.11.x' into next