Improved tests. Added exceptions thrown.