add test for create, attach, detach encoder + bugfixes