Correct function call that does not exist.
Fixed memory leak.
Missed return value.
Fixed dlsym usage and coding style.