Fix initialising local buffers. Also fix calls to get_linear.