Fixed bugs in Shape.Utils.triangulateShape

Fixed issues in the triangulateShape method (a for..in loop was used where a sequential for loop is required). 
A for..in loop should be avoided when using array like objects, because it also enumerates inherited properties and iteration order is not guaranteed.