Fix trash code
Fix problems in tests