Attempt at fixing context destruction problem.

Need to find out when the context gets destroyed...