Bringing bug fixes from pipeline to here