Nothing in this chapter contained shall be so construed as to alter or affect the terms of any special contract in writing, made by the parties as to the advances, affreightment, wharfage or storage; but when any such special contract shall have been made, its terms shall govern irrespective of this chapter.