divided sed with multiple expressions into multiple commands
added more fixes to chroot hook script