Fixed an error that occurred when testvars had un-used levels