Fixed bugs introduced in last couple commits.