Cleaning up contributed code a bit.