Corrected types based on dialyzer warnings.