Fixes for the obvious bug from this weeks coverity scan.

Just one obvious bug from this weeks coverity scan.