Fix creation of plot