[TIMOB-14360] Avoid overflow

Test is in [JIRA](https://jira.appcelerator.org/browse/TIMOB-14360)