Fixed tests, and added basic coverage