Fix logic of the build-demos flag