fixing compile errors and warings in tests and examples