Fixes #61

Due to the fact that the order of the results of a dict can be unpredictable, this was failing. This commit changes the type of check to workaround this problem.