Fix on-demand mode loading, fixes #182