Fixed duplicate register bug.