Fix build and main