core: new capture unit test and associated fixes