Multiple fixes, formatting
Minor improvements