Continued fixes to #52 and general cleaning.