Fix tons of crashes

Now that I have proper bug reporting, I can fix all the bad things :)
Fixes many errors in multiple places, especially for MTK devices (such
as Huawei P6, Cinq, etc)

Change-Id: If621bc97bf8b6c82bcbd8ea1684ad796bc1c64d3