Improved input and vector normalization