Adding tests
Changed exception name and added ref