Fixing bugs and tests, cleaning codes.
added missing annotations