fixed #4697. fix bad variable reference
some more integration testing
fixed #4697. some more integration testing
Merge branch 't-123' into develop