Supports deep pattern matching (Fixes #11)
Correctly checks previous definition in case of global execs.