Control of Harmful Effects during the Program Operation in NAND Flash Memories