Bug fixes/improvements