Multiple style fixes and code improvements