Fixes for #1243 #1191