Fix #30 and #32