Some fixes
bug fix complete