Fix for a couple bugs introduced by other changes