Fixing compile errors and dependency problems.