updates from changes introduced in commit 509777e