am d6f1f46b: Add some missing compat lib functions and fix a bug.

* commit 'd6f1f46b2929ed56c73ba32357cde31b82972fbe':
  Add some missing compat lib functions and fix a bug.