Fixes

Some fixes and improvements