Fixed kfree() calls which were generating errors.