Added 'Base m ~ IO` constraint to the safe functions