Finally wrote some unit tests