Improvements for #604