Fixed some stuff so that it actually works.