Some fixes/improvements