Fix infinite loop
Android compile fix
Add a bit of random
More fixes for static platforms