Various bugs fixed!