Added exceptions to clarify npe's