TST: add a more detailed test and fix a corresponding bug