Bug fix for g infinite
Bug fix for x infinite after normalisation