applying the changes for the case of ignore_border plus the changes for pep8 for issue #2196