fixes for rails3 and ruby 1.8