Updated restriction logic. Fixes #3