Fix reset layout 'crash'

Fixes #629.