Miscellaneous code.