Fix issues #268 and #269