Add check if merged matrix !empty. Add comments to mergeMatrix().