Switch to safe library to support <ghc 7.6