Small fixes to bugs introduced in last change