Fixed all issues with pull request (except the capybara test which will be added later