Critical compilation fixes and regenerate code