Memory Leak Fixes

Fixed a memory leak in the main form that involved issues with the
delegates.