Fix for issue #299

Here's a solution for the issue I raised earlier (#299)