Fix #34 and #38