Improved issue 17 fix