unsafe type tweaks and doc