Added debug option for logging. Fixed incorrect damage source
processing.