Fixed bug in padding with all zeros