Fixed bug causing memory leak - need to be careful using d.sound() as it
remembers the sound object.
Fixed ID get. Need to check what IDs are actually being assigned. All
seems to be working.