ImmutableVector index check
typo fix
refactoring and index checks
refactoring ImmutableMatrix asMatrix implementations