Pull request for issue #277