Linux bug fixes from main branch