Various fixes, mostly for readability