Fixes checking for open list and adds closed list check.