Finished fixing how errors are thrown
Added lots more tests