Fix some potentional issues.