Fix for safari empty buffer exception.