Fixed logic to not output if nothing to do