Save the current namespace since that is a state variable, too
Type 'number' now accepts any numeric value.
Refactor type and target-related code. Also add missing headers.