minor bugs fixes