Fix memory error.