Change the rank stuff slightly.
Move uglehack into own function.
Fixed nestedClassConstructorUgleHack.