My guess might be wrong, since I cannot execute the code and don’t know how the methods are used.
Feel free to post an executable code snippet, so that we could reproduce this issue and debug further.