Fixed array outofbounds and surpressed warning messages