Fixed some tests and find bugs violations