Fix edge case when exiting a minecart, consolidate minecart code