Fix rails40 builds