The attached patch addresses the following TRAC ticket:

Please review.