B-49476 Changed quality to a double and fixed related code