Fix additional bugs associated with dynamic-link