Properly deal with cache misses, get DB params from command line args, debug messages cleanup