Some cleanup in the dock.c code.