MADS: Fix calculating Rails::_next