Merge pull request #780 from sonjastrieder/master

Fix variable mat not being declared