Minor if/else statement combining.  Also added a preserve-3d optimization