fixed bug in quad mesh construction (wrong index order caused invalid quads)

Title says it all. It seems that we mixed up the index order for the quads when speeding up the for loops. The resulting quads were invalid: instead of adding (and checking) A-B-D-C it was doing A-B-C-D resulting in broken quads. 

A ---- B 
|        |
C --- D

Now fixed. Didn't find any bug reports mentioning broken quad meshes though.