Fix "Cannot read property of null/undefined".

Without .bind(this), when real device was used, it always failed on accessing "this" in these two functions.