Fix various errors for boot
Merged with qnhoang