Fixing a bug in the normalise function