Added casting at load time. Important for serialisation, but also for consistency