Minor bugs fixed