Fix NPE and regex kick