Fix #15 and #29.