Fix type in decode func