Added fixes related to matrix input from file