Fixed some ancient code so that it (hopefully) works now.