Remove binary.
Fix typo.
Fix tests. Fix bugs encountered by tests.