some subtle bugs