Quality improvements

Some random changes and fixes