Only access SCM info when available

Fixes #756.