Fixes and  improvements