Fix long-standing surface-attach bug