Fixing some Exceptions, adding comments