Fixed some errors and started work on improving the gui system