Bugfix: more flexible data reading