Fixed build and warnings