Fixed generator to use proper values. Fixed spatial query with correct distance