Fixes on restriction codes
Finished debugging tests