Fixing bugs in screenshot testing lib.