Type safety corrections.