Minor fixes and code formatting