Fixes to some debugging statements; better error message for module or function not found; fix bug in klog