Fix deregistration function.
v0.2.2