RSF-5 committed patch from Matthew Jones