Applying @andorsonamuller's fix in 64f3800991dadd49ae29ed8690c51daf69e8bcf8 to feature/bolt2