Factored out adjust_y_from_hints function and fixed minor 0 vs None bug