Minor fixes and improvs