Fixed some bugs. Everything basically works.