Rails3 fixes