Added some debug stuff + workaround for unmodifiable set

Signed-off-by: Niklas Ekman <niklas.ekman@gmail.com>