minor fixes
fixed checkActiveGateway for static case
dded test class for dynamic network