bug fixes/improvements