Fixed extreme deviation count function

Signed-off-by: plamen911 <plamen@lynxlake.org>