partially implement patch submitted by Clay Leeds (see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23821)