in some places you've used undefined for where context isn't supplied. Might it be an idea to do it here, and go from there instead of returning an empty binary.