Core: Many fixes