Minor fixes and enhancement