Bug minor fixes