Refers to #550. Not marking fixed because we need more tests. (cherry picked from commit 78ecc38b1b)
78ecc38b1b