Fixed goto fail bug
Fixed dereferencing (fd)
Removed useless declaration (item)
Fixed the check being inverted
Fixed some scope stuff which weren't that relevant anyway
Merge pull request #69 from Hamcha/feature/prefix_matching

Fixed some stuff