Fixed global constructors not getting called and added some required library functions to prevent linker errors