Fix some stuff that was causing misc errors on reference stuff