Better assignment handling and header validation