Adds basic error checking to de/register
Removes reference to cw.