Fixed wrong header includes+misplaced definitions