Fix build error and other tweaks