fixed check_pos_semidefinite so it works with 1x1 nan matrix