This patch is very similar to Pull Request #1.  Do you want to close the other and just do it all in this one?