Fixed problem with plotting