Improve statement tracking.
Merge branch 'dev'

* dev:
  Improve statement tracking.