Added some tests for $optional patter