Fixed malloc issues.