Minor cleanup of the modal / dialog creation routines