Added the throwing of exceptions at the appropriate files