Fix require bugs