Added changes from waldoj.