Some minor bug fix