Fixing buffer overflow on signals array