Fixed bug in chmod tool.