Fixed issue with https://gist.github.com/mikeschinkel/5028467 plus some commenting.