Add attribute restriction. Closes #31