Added additional support for 3.1 and multisites.