Add basic test, fix small bug.