Add some safety checks that storage functions are used correctly.