Only instantiate a BlockState when necessary

This fixes usage with $stdin.