Added test harness, corrected bugs...