Merged back changes.

License applied, integrated logging.