Fixed the bug in block matrix routines.