Fixed issues with update method.