check for unbound values; clean up JSON emission