[config][definition] Add tests and fix some relevante bugs