misc: fixed several compiler warnings and removed unused vars, refs #360