fixed null ptrs in wave.c