Initial fix for Rails2 (untested)