Fixed array layout when initializing from DOM element (fixes #116)