fixed bugs that useing in browserify will borken

Now it works well with browserify.