Fixing wrong implementation of the factorial function in haskell.