Add eventual ArrayOutOfBoundException, CastException and NPE checking