Fixing weight update.
Minor - format code.