quality fixes. Closed #837