Fixed potential indexoutofbounds exception on args