Added tests. Fixed errors in matrix operations in PetriNet.