Fixed error with trip.prev being nil in trip.rb