Don't reset stats when asked

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Simplify handling casts

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Add more comments

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>