Fixing small bug in matrix parsing