Merged dmcdougall's fix