Fix warnings unearthed by #579
Merge pull request #607 from Tilka/fix_warnings

Fix warnings unearthed by #579