register related bug fixes