Fix type error and require pretty print