Work on #50. Functional, fixes 1).