Added garbage collection

Not sure if this will fix OutOfMemoryException on weak computers, but
will try.