Added changes from elc branch.