Updated code with latest errata