Miscellaneous small helpful functions for COBRA