Matrix: Remove alignment check on Java side.
Matrix: Refactoring.