[[ Bug 13256 ]] Make sure styles array is large enough.
Merge branch 'bugfix-13256' into develop