More cleanup and fix #38