Fix build and other issues