Adding test, fixing minor bug.