Resolve issues reported by Scrutinizer

Signed-off-by: Bimal Yashodha <kb.yashodha@gmail.com>