Minor formatting fixes plus license headers.
Prevent double debug logging.