More fixes

I should really implement this as a CoffeeScript object next. Seems more idiomatic.