Various changes/fixes/improvements