Cleanup

Also fix a theoretical bug.