Changed the ordering of some package loading to work better with hyperref.