Fix system spec and tests

The following commits fix `bundle exec rake spec:system` and `bundle exec rake test`