Leveraging Linearity to Improve Automatic Amortized Resource Analysis