Correction from Aleksey Romanov <qqi@…> to finish off his patch. I had trouble merging his original patch and this corrected a reject.