Fix some compiler warnings, closing #1781.
Fixup previous commit