Fix register function

Related to
#71