fixed some plotting bugs