Better error on register with bad argument