Made get_*or_flush() more versatile; failed attempt at optimization