fix: node#last= didn't handle nil
temporary fix. Maybe node#last should check the type or we shouldn't use
last for the nodes#next in the first place