Fixes layer constraint for i/o nodes

Pointed in #118.