Fixed wrong constants for [MIN|MAX]_QUALITY_VALUE; they are also used for checking the input instead of hardcoded numbers