Commit first fixes, cleanups and formating code