Fixed const pointers, corrected function args

Fixed compiler error with const pointer casting, corrected
arguments to addToList call.