finishes tests, fixes bugs found during testing