MAINT: cleanup unnecessary code
ENH: add better error message for misaligned matrices

based on gh-4985 by Lars Buitinck