Made exception more general.