[FileMap] Fixed exception type and cleaned up.
[Shell] Fixed exit issue in run loop for commands delivery.