Timob 16938

https://jira.appcelerator.org/browse/TIMOB-16938

This is PR #6330 plus indentation fixes.