Fix build and install logic