Add some exceptions; change exception constructors to internal.