Now checks if file exists. Also does line error detection.