Fixed test failure and improved post_delete_layer logic.
Merge pull request #1032 from garnertb/travis_fix

Fixed test failure and improved post_delete_layer logic.