Some bug fix's