Fixed minor bugs introduced by recent commits