Updated Gemfile and fixed various bugs