Incorporated the suggested changes related to Issue #589 by @kcooney