Fixed casting problems in network classes