Added new debug features

Small cleaning also