The stock split action in the code is considered a 0-priced acquisition. This works as long as there is no bed&breakfast to consider (no sale in the previous 30 days).
It would be nice to fix the calculation to handle this case as well, or, at a very least, to throw an error to avoid silently incorrect calculation.