Fixing a bug in function spec