Made external average interface generic
Correct rounded int division for -ve numbers
Correct test macro for memory pool