Fixes for issues #1111 and #1129