Test and fix state monad's functor implementation