Patch for issue #284