backported ca050a8d57a771d24de2cdf3e3d56e5ff6bc278c to railsexpress

patches for 2.1.0.

can you please merge?