Fix two bugs from the last merge