Fix plotting bug and reorder conditionals