Update layout.js

Fix for #2