Fix register_spec bug