Cleaned up the patch a bit.