Fix PEP-8 formatting and 'datatime' imported but not used