[0.3] Fix random CS issues found by Scrutinizer-CI