Add feature requested in issue 477