More fixes for rails3 version