Small bugs fixes