[BUGFIX] Check that repositories are of singleton scope
Repositories must be singletons, otherwise strange things and
seemingly weird errors happen. This change adds a check for the
scope, so that developers at least know what is wrong.