fixed some warnings, renamed register_this, to reg_type for consitency