Small fixes to make matrix input work