[TASK] Fix several issues mentioned by scrutinizer

Releases: 2.0.0
Change-Id: I5790d86ac7936ae6f18807fc8417a892defffa4a