Fix PEP8 warnings
Do not use deprecated patterns