Some bug fixes
final before release
fixed perl script