Tweak towards api-7 compatibility

Signed-off-by: Andy Han <andyhan2000@gmail.com>