Fix some compiler warnings

These fix compiler warnings present under EL6's GCC, there may be
others. Some unused variable declarations have also yet to be handled