Fix Coverity warnings - part. 1
Rebase API