tests (almost) fixed and exceptions added