Fixes for #297