Miscellaneous utils.