Add some tests and fix ID issue