Fixed exception handling during context registration