Fix issues when generating static files

Cause by some regressions. Add basic rake specs to avoid similar issues in the
future.