Fixes running rake test_app.

Fixes #3024