Various useful extension methods.