Revert "Miscellaneous fixes"

This reverts commit a0e25fce018283177c678e6901bc650ec183aa9c.
Re-applying fixes with corrected author