Fixes for #472 and #265