Merge "heat: minor fixes, don't use len > 0 and use next instead of [0]"