100% test coverage and small bugfix in case of broken bson