Fixed a bunch of bugs, rendering works.