Fix build errors/warnings