Regression: Fix a bug in attachment loading