Fixed bug in the spatial pyramid computation