Replaced error handling (most often die's) with returned status codes in scanner