renda effect improved
bug fix

fix bug, mixing up matrix is None and bool(matrix)(which invokes
__nonzero__ method)