General fixes. Should now be functional.