Minor logic improvement