Miscellaneous code updates