Thanks for your input Matthew -- it's always appreciated. Here's a new patch taking into account Matthew's comments.