Fix NPE caused by #676, close #678