Bug fix for read()