Fix class type test
Tidyup
Update debug messages
Update status inversion