Fix some issues flagged by Coverity static analysis