Fix onEnd and onBegin not copied to this.

Signed-off-by: Szymon Nowak <szimek@gmail.com>
Release v1.3.2.