Padding zeros and minor fixes