Issue #49 - fixed Date and ExpireDate checking logic

Issue #49 - fixed Date and ExpireDate checking logic
Also cleaned up some PEP8 and Flake8 formatting errors.