Fixed bug in HOG