Fixing some issues with the sqldirect source.