Fixed some errors in regexp generation