fix layout unittest, each layout set* function returns the object
fix unittest error.
throw exception when matrix is missing some data