Some fixes and formatting