Fix unused variable warnings
Minor fixes to build system