Various fixes/improvements see commit list