Small fixes and improovements