Tweaked some pattern matching in lambda