Minor bugs fix