Fixed minor bugs introduced by a recent commit