Fixed more database/variable issues
Added ability to trace log messages