MInimum scalar product search, more logs, code cleanup.