Fix #19 and #21