Multiple bug fix