Bugfix + Performance (battery) improvement for JS