Fix paths. Add hog tests and improve hog algorithm.