add typeassert to ensure that variables with a declared type always behave that way regardless of what convert() does. fixes #271