Regression, incorrectly stripping const.
Moved some error checks from dyn. to static.