Adding auxiliary functions for testing.