Revert "various fixes"

This reverts commit 59b68a6b9700eef0f2328211a6a63f5e44ad2429.