FIX - prevent negative array size

This pull request aim to prevent negative array size when calculating "segments".
A code snippet similar to this 

		myobj.myattr = myFunctionCall({ 
			onlyOneAttributeHere: 0
		});

was causing a crash in the gulp task