Fixed some bugs... I hope.