Added missing Function.prototype.bind (PhantomJS)
Fixed refactoring mistakes