Fix issues #236 and #237