Fix use of np.pad for old Numpy versions