Small adjustments

Fixed small bug in states.py and improved the table naming process in stream.py.