fix some visual/matrix buffer issues