sapG bug fix. Closes #662.