Fixing unit tests and adding cleaner rake tasks