[Fix #247] uninitialized index was mistakenly used in subseting

   ... also fix all GCC warnings which appear on --pedantic flag