Better type checking inside safeAttributes and activeAttributes.