am d9b09fa9: Merge "Fix registerListener and flush bugs." into klp-dev

* commit 'd9b09fa97eb47b051bbfab8cc491143198fbc9bc':
  Fix registerListener and flush bugs.