Fix for issue 397