Pull request for Issue665