Enhance state function output (fix #7)