Some refactor and bug fixes to redstone networks.