Adding register updates and fixed syntax errors.
Minor fix.