Revert fixes

I don't know what happens here but seems to many things have been reverted 

https://github.com/rails/rails/commit/ec8ef1e1055c4e1598da13f49d30261f07f4a9b4

I have add few back as far as I know of. I will look more of these from this commit.