Fix NPE (issue #23).