Fix #20 and #21