Xep 0016 bug fixing

while using found some bugs
these are fixes and more tests