Bugfixes for VI plotting support, and some cleanup