Added changes from tpodom.