Fixed bug -- ArrayIndexOutOfBounds in setResources( )