Add code to handle some special cases.