Minor fixes and improvement