Smaller logic bug fix