fix a bug, fix a test