more lib stuff
handle empty cases in js optimizer