Fixed compilation error and test driver for dynamic loading