Some changes to make it work with Passenger