Fixed problem 3 to work with Browserify.
Merge problem 3 fixes from master.