Fixed bug related to the randomized padding