Added some checks to prevent array out 
of bounds errors.


git-svn-id: svn://svn.code.sf.net/p/elmerfem/code/trunk@6792 04224531-1f84-46d8-96ce-875b9e37dce3