Must decrement instance for already-registered devices or else registrat...

...ion of new device won't trigger at the right slot. I also fixed the realloc subroutine. Now String operations work correctly.