Replace requireindex with a less crappy alternative