Fixed few bugs. And i found one definitely compiler bug