Fix two small bugs in the last patch