Added finalize for checkStatement.  Fix #122