Updating SQL check to check for NULL pointer instead of config

It's much more robust
Removing useless indirection in Solver
Re-adding the only needed redirection in solver.cpp