Add some missing compat lib functions and fix a bug.

Change-Id: I2950e1b4f785bcc1f0b6154ce822fe17832b3f4f
3 files changed