Fix Matrix#set and other small changes
Merge pull request #1305 from xoppa/various

Fix Matrix#set and other small changes