Merge pull request #2061 from phire/make-things-better Cleanup DotProduct function to make it more readable.