Cleaned up code to accept read and segment sizes with out any letter for size, defaults to bytes

Cleaned up code to accept read and segment sizes with out any letter
for size, defaults to bytes.
Also added check for case where file is not valid.