Added runtime tests.
Changed raised exceptions