Fixes bugs after resuming from suspend/hibernate
Improve performance slightly