Revert "Revert "more fixes""

This reverts commit 2355cf590cd0017f17fa6b455e4c6961b0814e31.