Some fixes and improvements of code style