Completed fix for ticket #1. Merged r3160:3168 from