[ALOY-1048] backport fix to 1_4_X

Cherry-pick reported that commit was empty, so re-implementing this 1.5.0 fix for 1.4.0

For https://jira.appcelerator.org/browse/ALOY-1048