Fix bug with register