fix warnings and add pointers