Revert "Cumulative fixes for #2542 #2544"

This reverts commit 0b68e19729e439b8dc4e7574b6dbaf05e447f3b2.