some fixes/improvements