Fixes for #1111 and #1116