Fixed some warning messages when using matrix jobs and index out of
range problems.
More 'index out of bounds' fixes and matrix-related problems
Merge pull request #2 from david-caro/master

Added some checks to avoid WARNING messages