added a couple more fixes for rails 3.1