Layout and removed debug output
Bugfix: normalization and check for type equality was missing!