Updated license headers. Fixed scope bugs.