Simplified the creation and checking of guards
Merge pull request #181 from mdxs/simplify_guards

Simplified the creation and checking of guards