jsutil cleanup, corner case fixes