Fix errors introduced in previous bug fix