bugfix issue with valid quality after value changing.
reviewed for many non-pep8 lines.