Fixed bug in downstream code