Fix NPE on old Androids
Merge branch 'optimize-memory-squaretask'