Chasing a segfault, when program exits

Potential fix for pdn and cleaned up Gameboy Plugin code.