bug fix and PEP conformity