.Gif exporting, minor fixes

Gif exporting works now and a couple of minor obscure bugs causing
crashes have been fixed