Cleaned up most magic numbers, fixed Android/Linux support