Test Bug fixes
Fixed some possible bugs