Fixing test, adding unit test for attach