General update. Fixed some bugs.