Replaced deprecated Control.Monad.Error with Control.Monad.Except