Get rid of unused function warnings, cleanup redundant flags

Change-Id: I9331ad19e4154d369e56a666d88cf2fb017a9dc5