Add a flags parameter to all decoding functions for future needs