Some padding and code cleanup