Speed up sqlite joins.
Check required shared libraries.
Simplify free macros.