Improvments to stash interaction

See discussion in #748