Fixed some bugs and set some stuff up.