Fixed bug in generator models

Fixed dirname and basename functions. Replace \ namespace delemiter to
/.