Fixed some bugs and changed rendering system.
Merge.