Fixed logic error in buff count tracker