Fix errors reported from codacy