Fix conditional execution, write basic tests for it. Fixes #18