Core: Fix warnings and some cleanup (Thx Vincent-Michael)