Fixing manager and adding more tests for it