Fixes in index.js

Was just trying out the tip code, as it includes a fix not included in 0.0.5 (the undefined username variable in plain.js, which you fixed in ff57cc908), and found a couple of problems loading the library.  These changes fixed it for me.