Misc functions for AlignDB