As compared to the previous version, the example of Gupta-Bleuler quantization of massive electrodynamics was added, and the derivation of path integral for anomalous theories is further elaborated. This is the final version to be published in Annals of Physics.