Added tests and, yeah, modified a few things.