Fix error when registration does not exist (closes #345)