Make tests pass, and some edits