Added distributed sparse dot tests and fixed bugs.