small tweaks and fixes for rails3