Add dependencies and fix build