Removing diagnostic code