Fix #24, clean up according to repoman's suggestions