Fixes #309 and adds missing specs to cover registration.