Small fixes and tests!