Put in regression tests, fixed small bugs, improved exceptions #88