Can you provide more details? The code you have seems identical to delete_last() so I'm curious to know the issue. If you think this can be done later I can merge this now and do the cleanup later.