Fixed NPE closes #20