Fix issue #36 and #35.