TLS fixes, mainly alignment handling