Copying from GoogleCode repository.