Fixed typo.
Added assert for better exception message when no identifier exists.