Changed Buffer type check to help browserify