fix some initialization and link time issues