refs #948 Fix bad code