Tackled some crucial (memory) bugs

- The JSON object decimal_ value was defined wrongly
inside the values union, but it thereby corrupt values
already in the union.
- The device and gui config was wrecked when a user
didn't explicitly define a media setting in the gui.
- The raw and debug program didn't terminate,
because of an incomplete garbage collection.