Fix #1 for non-square matrices