Fixed NullPointerException when not capturing groups.