Fixed stupid error in ToplevelType
Fixed ranges that were broken due to recent changes.
Running more tests.