Fixed register bug.