Fix a pair of defects uncovered by coverity

Resolves rhbz#1056584