Minor bugs fixed and gui improved