Hopefully it's going to fix warnings about bad reference item in Item::stackBefore(). (cherry picked from commit 5555ed28)