Fixed some bugs :)

Fixed a bug whereby the scanner would terminate at any null bytes.