Fix NPE when deleting the first statement