Fix storage const autoload

Superseeds #9587

cc @icewind1991 @PVince81 @schiesbn @th3fallen @DeepDiver1975 @speijnik