Make getQuality always return an integer.
Enforce min and max value for scaling quality.
Merge pull request #3 from khink/master

Make getQuality always return an integer.