Fixed and reduced validation & sync code.