diff --git a/src/zscanner/NOTES b/src/zscanner/NOTES
index f7c8f1b806123678d79f3d8df9ce80a2fab49763..813f7c5b73ccbb23eecc826596c360ffd3782d20 100644
--- a/src/zscanner/NOTES
+++ b/src/zscanner/NOTES
@@ -1,17 +1,17 @@
 - supported types: A, NS, CNAME, PTR, DNAME, SOA, HINFO, MINFO, MX, AFSDB, RT,
                    KX, TXT, SPF, RP, AAAA, LOC, SRV, NAPTR, CERT, DS, SSHFP,
                    IPSECKEY, RRSIG, NSEC, KEY, DNSKEY, DHCID, NSEC3, NSEC3PARAM,
-                   TLSA, APL, EUI48, EUI64, NID, L32, L64, LP, UNKNOWN
+                   TLSA, APL, EUI48, EUI64, NID, L32, L64, LP, TYPE12345
 - the class IN is supported only (CLASS12345 notation is not supported too)
 - the newline character is appended to each zone file during processing
   (for simplicity)
 - domain names can contain alphanumeric, '-', '_' and '/' characters
-- \x and \DDD notations are allowed in domain names and text strings only
+- \x and \DDD notations are allowed in domain names and in text strings
 - @ can be used instead of domain names anywhere (excluding directives)
 - directive $INCLUDE is allowed in included zone files (BEWARE of recursion)
 - relative file path is relative to parent zone file
-- blank zone file causes error (same rule is for included zone file)
-- the line numbers of multiline records are the numbers of the last lines with
+- blank zone file causes error (the same rule is for included zone file)
+- line numbers of multiline records are numbers of the last lines with
   appropriate record parts
 - items parts lengths must be multiples of 2 for HEX, 4 for base64 and 8 for
   base32hex blocks (but DHCID example from RFC is more general!)
diff --git a/src/zscanner/error.c b/src/zscanner/error.c
index d4bc40bdea543a0652deee36281f097283689a42..e12419b0afc1c59d03437f0463cf1d58ec5b2a90 100644
--- a/src/zscanner/error.c
+++ b/src/zscanner/error.c
@@ -31,7 +31,6 @@ const err_table_t err_msgs[] = {
 	{ FLOADER_EFSTAT, "Fstat error." },
 	{ FLOADER_EDIRECTORY, "Zone file is a directory." },
 	{ FLOADER_EEMPTY, "Empty zone file." },
-	{ FLOADER_EDEFAULTS, "Zone defaults processing error." },
 	{ FLOADER_EMMAP, "Mmap error." },
 	{ FLOADER_EMUNMAP, "Munmap error." },
 	{ FLOADER_ESCANNER, "Zone processing error." },
diff --git a/src/zscanner/error.h b/src/zscanner/error.h
index c5c9f34054c9bf1a191cc0a54095a979d143e2fe..7df16a8810bfb9f90f31061f6d7f27b0a517cbfb 100644
--- a/src/zscanner/error.h
+++ b/src/zscanner/error.h
@@ -31,7 +31,6 @@ enum err_codes {
 	FLOADER_EFSTAT = -1000,
 	FLOADER_EDIRECTORY,
 	FLOADER_EEMPTY,
-	FLOADER_EDEFAULTS,
 	FLOADER_EMMAP,
 	FLOADER_EMUNMAP,
 	FLOADER_ESCANNER,
diff --git a/src/zscanner/file_loader.c b/src/zscanner/file_loader.c
index 9ca4f88ba074b465247d6668a1dffbff9efc9713..9f6741987654f208c58b8830df864e8590afd354 100644
--- a/src/zscanner/file_loader.c
+++ b/src/zscanner/file_loader.c
@@ -33,62 +33,14 @@
  */
 #define BLOCK_SIZE      30000000
 
-/*!
- * \brief Processes zone settings block.
- *
- * Before zone file processing via scanner it's necessary to process first
- * settings block using this function. Settings block contains ORIGIN and
- * TTL directive.
- *
- * \param fl		File loader structure.
- *
- * \retval  0		if success.
- * \retval -1		if error.
- */
-static int load_settings(file_loader_t *fl)
+file_loader_t* file_loader_create(const char     *file_name,
+                                  const char     *origin,
+                                  const uint16_t rclass,
+                                  const uint32_t ttl,
+                                  void (*process_record)(const scanner_t *),
+                                  void (*process_error)(const scanner_t *),
+                                  void *data)
 {
-	int		ret;
-	scanner_t	*settings_scanner;
-
-	// Temporary scanner for zone settings.
-	settings_scanner = scanner_create(NULL);
-
-	// Use parent processing functions.
-	settings_scanner->process_record = fl->scanner->process_record;
-	settings_scanner->process_error  = fl->scanner->process_error;
-
-	// Scanning zone settings.
-	ret = scanner_process(fl->settings_buffer,
-			      fl->settings_buffer + fl->settings_length,
-			      true,
-			      settings_scanner);
-
-	// If no error occured, then copy scanned settings to actual context.
-	if (ret == 0) {
-		memcpy(fl->scanner->zone_origin,
-		       settings_scanner->zone_origin,
-		       settings_scanner->zone_origin_length);
-		fl->scanner->zone_origin_length =
-			settings_scanner->zone_origin_length;
-		fl->scanner->default_ttl = settings_scanner->default_ttl;
-	}
-
-	// Destroying temporary scanner.
-	scanner_free(settings_scanner);
-
-	return ret;
-}
-
-file_loader_t* file_loader_create(const char	 *file_name,
-				  const char	 *zone_origin,
-				  const uint16_t default_class,
-				  const uint32_t default_ttl,
-				  void (*process_record)(const scanner_t *),
-				  void (*process_error)(const scanner_t *),
-				  void *data)
-{
-	int ret;
-
 	// Creating zeroed structure.
 	file_loader_t *fl = calloc(1, sizeof(file_loader_t));
 	if (fl == NULL) {
@@ -107,7 +59,8 @@ file_loader_t* file_loader_create(const char	 *file_name,
 	}
 
 	// Creating zone scanner.
-	fl->scanner = scanner_create(file_name);
+	fl->scanner = scanner_create(fl->file_name, origin, rclass, ttl,
+	                             process_record, process_error, data);
 	if (fl->scanner == NULL) {
 		close(fl->fd);
 		free(fl->file_name);
@@ -115,27 +68,6 @@ file_loader_t* file_loader_create(const char	 *file_name,
 		return NULL;
 	}
 
-	// Setting processing functions and data pointer.
-	fl->scanner->process_record = process_record;
-	fl->scanner->process_error  = process_error;
-	fl->scanner->data = data;
-
-	// Default class initialization.
-	fl->scanner->default_class = default_class;
-
-	// Filling zone settings buffer.
-	ret = snprintf(fl->settings_buffer,
-		       sizeof(fl->settings_buffer),
-		       "$ORIGIN %s\n"
-		       "$TTL %u\n",
-		       zone_origin, default_ttl);
-	if (ret <= 0 || (size_t)ret >= sizeof(fl->settings_buffer)) {
-		file_loader_free(fl);
-		return NULL;
-	}
-
-	fl->settings_length = ret;
-
 	return fl;
 }
 
@@ -187,13 +119,6 @@ int file_loader_process(file_loader_t *fl)
 	// Number of blocks which cover the whole file (ceiling operation).
 	n_blocks = 1 + ((file_stat.st_size - 1) / default_block_size);
 
-	// Process settings using scanner (like initial ORIGIN and TTL).
-	ret = load_settings(fl);
-
-	if (ret != 0) {
-		return FLOADER_EDEFAULTS;
-	}
-
 	// Loop over zone file blocks.
 	for (block_id = 0; block_id < n_blocks; block_id++) {
 		scanner_start = block_id * default_block_size;
@@ -208,28 +133,27 @@ int file_loader_process(file_loader_t *fl)
 
 		// Zone file block mapping.
 		data = mmap(0,
-			    block_size,
-			    PROT_READ,
-			    MAP_SHARED,
-			    fl->fd,
-			    scanner_start);
-
+		            block_size,
+		            PROT_READ,
+		            MAP_SHARED,
+		            fl->fd,
+		            scanner_start);
 		if (data == MAP_FAILED) {
 			return FLOADER_EMMAP;
 		}
 
 		// Scan zone file.
 		ret = scanner_process(data,
-				      data + block_size,
-				      false,
-				      fl->scanner);
+		                      data + block_size,
+		                      false,
+		                      fl->scanner);
 
 		// Artificial last block containing newline char only.
 		if (is_last_block == true && fl->scanner->stop == 0) {
 			ret = scanner_process(zone_termination,
-					      zone_termination + 1,
-					      true,
-					      fl->scanner);
+			                      zone_termination + 1,
+			                      true,
+			                      fl->scanner);
 		}
 
 		// Zone file block unmapping.
diff --git a/src/zscanner/file_loader.h b/src/zscanner/file_loader.h
index 5a840b1cf60c492d0c54489294c8ec005ceac395..eaab9e5aeee094f85dd27775f046a5cdd8c96843 100644
--- a/src/zscanner/file_loader.h
+++ b/src/zscanner/file_loader.h
@@ -30,36 +30,24 @@
 #include <stdint.h>			// uint32_t
 
 #include "zscanner/scanner.h"		// scanner_t
-#include "zscanner/descriptor.h"	// KNOT_CLASS_IN
-
-/*! \brief Settings block size in bytes. */
-#define SETTINGS_BUFFER_LENGTH		 1024
-/*! \brief Default ttl value. */
-#define DEFAULT_TTL			 3600
-/*! \brief Default class value. */
-#define DEFAULT_CLASS		KNOT_CLASS_IN
 
 /*! \brief Structure for zone file loader (each included file has one). */
 typedef struct {
 	/*!< File descriptor. */
-	int	  fd;
+	int       fd;
 	/*!< Zone file name this loader belongs to. */
-	char	  *file_name;
+	char      *file_name;
 	/*!< Zone scanner context stucture. */
 	scanner_t *scanner;
-	/*!< Zone settings buffer. */
-	char	  settings_buffer[SETTINGS_BUFFER_LENGTH];
-	/*!< Length of zone settings buffer. */
-	uint32_t  settings_length;
 } file_loader_t;
 
 /*!
  * \brief Creates file loader structure.
  *
  * \param file_name		Name of file to process.
- * \param zone_origin		Initial zone origin (used in settings block).
- * \param default_class		Default class value.
- * \param default_ttl		Default ttl value (used in settings block).
+ * \param origin		Initial zone origin.
+ * \param rclass		Zone class value.
+ * \param ttl			Initial ttl value.
  * \param process_record	Processing callback function.
  * \param process_error 	Error callback function.
  * \param data			Arbitrary data useful in callback functions.
@@ -67,13 +55,13 @@ typedef struct {
  * \retval file_loader		if success.
  * \retval 0			if error.
  */
-file_loader_t* file_loader_create(const char	 *file_name,
-				  const char	 *zone_origin,
-				  const uint16_t default_class,
-				  const uint32_t default_ttl,
-				  void (*process_record)(const scanner_t *),
-				  void (*process_error)(const scanner_t *),
-				  void *data);
+file_loader_t* file_loader_create(const char     *file_name,
+                                  const char     *origin,
+                                  const uint16_t rclass,
+                                  const uint32_t ttl,
+                                  void (*process_record)(const scanner_t *),
+                                  void (*process_error)(const scanner_t *),
+                                  void *data);
 
 /*!
  * \brief Destroys file loader structure.
@@ -90,16 +78,15 @@ void file_loader_free(file_loader_t *file_loader);
  * syntax error occures, then process_error callback function is called.
  *
  * \note Zone scanner error code and other information are stored in
- * fl.scanner context.
+ *       fl.scanner context.
  *
  * \param file_loader	File loader structure.
  *
  * \retval ZSCANNER_OK	if success.
- * \retval error_code   if error.
+ * \retval error_code	if error.
  */
 int file_loader_process(file_loader_t *file_loader);
 
-
 #endif // _ZSCANNER__FILE_LOADER_H_
 
 /*! @} */
diff --git a/src/zscanner/scanner.h b/src/zscanner/scanner.h
index 7a437edccd2a2c886a33fc1fe1911dabe79cca02..bbb3880a69e2418888fca92e5497c421e00abab2 100644
--- a/src/zscanner/scanner.h
+++ b/src/zscanner/scanner.h
@@ -31,36 +31,36 @@
 #include <stdbool.h>			// bool
 
 /*! \brief Maximal length of rdata. */
-#define MAX_RDATA_LENGTH	       65535
+#define MAX_RDATA_LENGTH		65535
 /*! \brief Maximal length of rdata item. */
-#define MAX_ITEM_LENGTH			 255
+#define MAX_ITEM_LENGTH			255
 /*! \brief Maximal length of domain name. */
-#define MAX_DNAME_LENGTH		 255
+#define MAX_DNAME_LENGTH		255
 /*! \brief Maximal length of domain name label. */
-#define MAX_LABEL_LENGTH		  63
+#define MAX_LABEL_LENGTH		63
 /*! \brief Maximal number or rdata items. */
-#define MAX_RDATA_ITEMS			  64
+#define MAX_RDATA_ITEMS			64
 
 /*! \brief Number of bitmap windows. */
-#define BITMAP_WINDOWS			 256
+#define BITMAP_WINDOWS			256
 
 /*! \brief Length of ipv4 address in wire format. */
-#define INET4_ADDR_LENGTH		   4
+#define INET4_ADDR_LENGTH		4
 /*! \brief Length of ipv6 address in wire format. */
-#define INET6_ADDR_LENGTH		  16
+#define INET6_ADDR_LENGTH		16
 
 /*! \brief Ragel call stack size (see Ragel internals). */
-#define RAGEL_STACK_SIZE		  16
+#define RAGEL_STACK_SIZE		16
 
 /*! \brief ASCII value of '0' character. */
-#define ASCII_0				  48
+#define ASCII_0				48
 
 /*! \brief Latitude value for equator (2^31). */
 #define LOC_LAT_ZERO	(uint32_t)2147483648
 /*! \brief Longitude value for meridian (2^31). */
 #define LOC_LONG_ZERO	(uint32_t)2147483648
 /*! \brief Zero level altitude value. */
-#define LOC_ALT_ZERO	  (uint32_t)10000000
+#define LOC_ALT_ZERO	(uint32_t)10000000
 
 /*! \brief Auxiliary structure for storing bitmap window items (see RFC4034). */
 typedef struct {
@@ -86,51 +86,27 @@ typedef struct {
 } loc_t;
 
 /*!
- * \brief Context structure for Ragel scanner.
+ * \brief Context structure for zone scanner.
  *
  * This structure contains folowing items:
- *  - Copies of Ragel internal variables. The scanner is called many times
- *    for each block of zone file. So it is necessary to preserve internal
- *    values between subsequent scanner callings.
+ *  - Copies of Ragel internal variables. The scanner can be called many times
+ *    on smaller parts of zone file/memory. So it is necessary to preserve
+ *    internal values between subsequent scanner callings.
  *  - Auxiliary variables which are used during processing zone data.
- *  - Zone file and error information.
  *  - Pointers to callback functions and pointer to any arbitrary data which
  *    can be used in callback functions.
- *  - Output variables containing all parts of zone record. These data are
- *    usefull during processing via callback function.
+ *  - Zone file and error information.
+ *  - Output variables (r_ prefix) containing all parts of zone record. These
+ *    data are usefull during processing via callback function.
  */
 typedef struct scanner scanner_t; // Forward declaration due to arguments.
 struct scanner {
 	/*! Current state (Ragel internals). */
-	int	 cs;
+	int      cs;
 	/*! Stack top (Ragel internals). */
-	int	 top;
+	int      top;
 	/*! Call stack (Ragel internals). */
-	int	 stack[RAGEL_STACK_SIZE];
-
-	/*! Absolute path for relative includes. */
-	char     *path;
-	/*! Zone file name, if specified. */
-	char     *file_name;
-	/*! Zone file line counter. */
-	uint64_t line_counter;
-
-	/*! Last occured error/warning code. */
-	int      error_code;
-	/*! Errors/warnings counter. */
-	uint64_t error_counter;
-	/*!
-	 * Indicates serious warning which is considered as an error and
-	 * forces zone processing to stop.
-	 */
-	bool     stop;
-
-	/*! Callback function for correct zone record. */
-	void (*process_record)(const scanner_t *);
-	/*! Callback function for wrong situations. */
-	void (*process_error)(const scanner_t *);
-	/*! Arbitrary data useful inside callback functions. */
-	void *data;
+	int      stack[RAGEL_STACK_SIZE];
 
 	/*! Indicates whether current record is multiline. */
 	bool     multiline;
@@ -186,6 +162,29 @@ struct scanner {
 	/*! Value of the current default ttl (TTL directive sets this). */
 	uint32_t default_ttl;
 
+	/*! Callback function for correct zone record. */
+	void (*process_record)(const scanner_t *);
+	/*! Callback function for wrong situations. */
+	void (*process_error)(const scanner_t *);
+	/*! Arbitrary data useful inside callback functions. */
+	void *data;
+
+	/*! Absolute path for relative includes. */
+	char     *path;
+	/*! Zone file name, if specified. */
+	char     *file_name;
+	/*! Zone file line counter. */
+	uint64_t line_counter;
+	/*! Last occured error/warning code. */
+	int      error_code;
+	/*! Errors/warnings counter. */
+	uint64_t error_counter;
+	/*!
+	 * Indicates serious warning which is considered as an error and
+	 * forces zone processing to stop.
+	 */
+	bool     stop;
+
 	/*!
 	 * Owner of the current record.
 	 *
@@ -228,17 +227,25 @@ struct scanner {
 /*!
  * \brief Creates zone scanner structure.
  *
- * \note After creation scanner structure, it is necessary to set next items:
- *       process_record, process_error, default_class, default_ttl, zone_origin.
- *
- * \param file_name	Zone file name. If parsing from memory use arbitrary
- *                      directory name (like "."), because relative includes
- *                      are considered to this file.
+ * \param file_name		Name of file to process (NULL if parsing from
+ * 				memory).
+ * \param origin		Initial zone origin.
+ * \param rclass		Zone class value.
+ * \param ttl			Initial ttl value.
+ * \param process_record	Processing callback function.
+ * \param process_error 	Error callback function.
+ * \param data			Arbitrary data useful in callback functions.
  *
  * \retval scanner	if success.
  * \retval 0		if error.
  */
-scanner_t* scanner_create(const char *file_name);
+scanner_t* scanner_create(const char     *file_name,
+                          const char     *origin,
+                          const uint16_t rclass,
+                          const uint32_t ttl,
+                          void (*process_record)(const scanner_t *),
+                          void (*process_error)(const scanner_t *),
+                          void *data);
 
 /*!
  * \brief Destroys zone scanner structure.
@@ -255,17 +262,17 @@ void scanner_free(scanner_t *scanner);
  *
  * \param start		First byte of the zone data to scan.
  * \param end		Last byte of the zone data to scan.
- * \param is_last_block	Indicates if current block is last.
+ * \param is_complete	Indicates if the current block is complete i.e. the
+ * 			last record line doesn't continue in the next block.
  * \param scanner	Zone scanner structure.
  *
  * \retval  0		if success.
  * \retval -1		if error.
  */
 int scanner_process(const char *start,
-		    const char *end,
-		    const bool is_last_block,
-		    scanner_t  *scanner);
-
+                    const char *end,
+                    const bool is_complete,
+                    scanner_t  *scanner);
 
 #endif // _ZSCANNER__SCANNER_H_
 
diff --git a/src/zscanner/scanner.rl b/src/zscanner/scanner.rl
index 6c9189e7515cda02551d1b402c2f19da0943045b..4d597669e9c107ea2416d0bf6a79e04409f54454 100644
--- a/src/zscanner/scanner.rl
+++ b/src/zscanner/scanner.rl
@@ -38,6 +38,14 @@
 /*! \brief Shorthand for setting error data. */
 #define SCANNER_ERROR(code)   { s->error_code = code; s->stop = true; }
 
+/*!
+ * \brief Empty function which is called if no callback function is specified.
+ */
+static inline void noop(const scanner_t *s)
+{
+	(void)s;
+}
+
 /*!
  * \brief Writes record type number to r_data.
  *
@@ -81,8 +89,16 @@ static inline void window_add_bit(const uint16_t type, scanner_t *s) {
 	write data;
 }%%
 
-scanner_t* scanner_create(const char *file_name)
+scanner_t* scanner_create(const char     *file_name,
+                          const char     *origin,
+                          const uint16_t rclass,
+                          const uint32_t ttl,
+                          void (*process_record)(const scanner_t *),
+                          void (*process_error)(const scanner_t *),
+                          void *data)
 {
+	char settings[1024];
+
 	scanner_t *s = calloc(1, sizeof(scanner_t));
 	if (s == NULL) {
 		return NULL;
@@ -102,14 +118,32 @@ scanner_t* scanner_create(const char *file_name)
 		s->file_name = strdup(file_name);
 	} else {
 		s->path = strdup(".");
-		s->file_name = strdup("");
+		s->file_name = strdup("<NULL>");
 	}
 
-	s->line_counter = 1;
-
 	// Nonzero initial scanner state.
 	s->cs = zone_scanner_start;
 
+	// Disable processing during parsing of settings.
+	s->process_record = &noop;
+	s->process_error = &noop;
+
+	// Create ORIGIN directive and parse it using scanner to set up origin.
+	int ret = snprintf(settings, sizeof(settings), "$ORIGIN %s\n", origin);
+	if (ret <= 0 || (size_t)ret >= sizeof(settings) ||
+	    scanner_process(settings, settings + ret, true, s) != 0) {
+		scanner_free(s);
+		return NULL;
+	}
+
+	// Set scanner defaults.
+	s->default_class = rclass;
+	s->default_ttl = ttl;
+	s->process_record = process_record ? process_record : &noop;
+	s->process_error = process_error ? process_error : &noop;
+	s->data = data;
+	s->line_counter = 1;
+
 	return s;
 }
 
@@ -123,9 +157,9 @@ void scanner_free(scanner_t *s)
 }
 
 int scanner_process(const char *start,
-		    const char *end,
-		    const bool is_last_block,
-		    scanner_t  *s)
+                    const char *end,
+                    const bool is_complete,
+                    scanner_t  *s)
 {
 	// Necessary scanner variables.
 	const char *p = start;
@@ -138,7 +172,7 @@ int scanner_process(const char *start,
 	struct in6_addr addr6;
 	uint32_t timestamp;
 	int16_t  window;
-	int	 ret;
+	int      ret;
 
 	// Next 2 variables are for better performance.
 	// Restoring r_data pointer to next free space.
@@ -152,7 +186,7 @@ int scanner_process(const char *start,
 	memcpy(stack, s->stack, sizeof(stack));
 
 	// End of file check.
-	if (is_last_block == true) {
+	if (is_complete == true) {
 		eof = (char *)pe;
 	}
 
diff --git a/src/zscanner/scanner_body.rl b/src/zscanner/scanner_body.rl
index 15eefd7ebf21a3a2a39fc2b36bb9dfc45340ca2f..c8abb4c8ff02dddef93addf1174afae0dcbf12c1 100644
--- a/src/zscanner/scanner_body.rl
+++ b/src/zscanner/scanner_body.rl
@@ -643,7 +643,7 @@
 	}
 
 	action _include_exit {
-		char text_origin[MAX_DNAME_LENGTH];
+		char text_origin[4 * MAX_DNAME_LENGTH]; // Each char as \DDD.
 
 		// Origin conversion from wire to text form.
 		if (s->dname == NULL) { // Use current origin.
@@ -668,8 +668,8 @@
 		// Create new file loader for included zone file.
 		file_loader_t *fl = file_loader_create((char*)(s->buffer),
 		                                       text_origin,
-		                                       DEFAULT_CLASS,
-		                                       DEFAULT_TTL,
+		                                       s->default_class,
+		                                       s->default_ttl,
 		                                       s->process_record,
 		                                       s->process_error,
 		                                       s->data);
diff --git a/src/zscanner/scanner_functions.h b/src/zscanner/scanner_functions.h
index f20219f38e22e87a57b5c47797ec34dd4fb60fb0..51a1a0f9d017b4f2b0edd08e52d9ff18c0ae80b0 100644
--- a/src/zscanner/scanner_functions.h
+++ b/src/zscanner/scanner_functions.h
@@ -96,8 +96,8 @@ int date_to_timestamp(uint8_t *buff, uint32_t *timestamp);
  * \param text		Text output.
  */
 void wire_dname_to_str(const uint8_t  *data,
-		       const uint32_t data_len,
-		       char *text);
+                       const uint32_t data_len,
+                       char *text);
 
 /*!
  * \brief Converts unsigned integer to mantisa*10^(exponent).
diff --git a/src/zscanner/test/processing.c b/src/zscanner/test/processing.c
index 438c3723ee743b3385df6364498f51511e30632d..44e209ea7d16857721a59c0adc8ce5bcf84b7152 100644
--- a/src/zscanner/test/processing.c
+++ b/src/zscanner/test/processing.c
@@ -101,11 +101,6 @@ static void print_wire_dname(const uint8_t *dname, uint32_t dname_length)
 	}
 }
 
-void empty_process(const scanner_t *s)
-{
-	(void)s;
-}
-
 void debug_process_error(const scanner_t *s)
 {
 	if (s->stop == true) {
diff --git a/src/zscanner/test/processing.h b/src/zscanner/test/processing.h
index 26db2153254b3bbb8e4a04d9ef0503b862ecc2dd..8eacd88e948f47bf0174dd5835bd4ba789933ccb 100644
--- a/src/zscanner/test/processing.h
+++ b/src/zscanner/test/processing.h
@@ -29,8 +29,6 @@
 
 #include "zscanner/scanner.h"
 
-void empty_process(const scanner_t *scanner);
-
 void debug_process_error(const scanner_t *scanner);
 
 void debug_process_record(const scanner_t *scanner);
diff --git a/src/zscanner/test/zscanner-tool.c b/src/zscanner/test/zscanner-tool.c
index fcb2c3ec41ab3e8c66bcb41b101e76d25c993c06..b1fd1d576c7c4a762364efce92dd99bbf92e59d0 100644
--- a/src/zscanner/test/zscanner-tool.c
+++ b/src/zscanner/test/zscanner-tool.c
@@ -26,6 +26,8 @@
 #include "zscanner/test/tests.h"	// test functions
 
 #define DEFAULT_MODE	1
+#define DEFAULT_CLASS	1
+#define DEFAULT_TTL	0
 
 void help(void)
 {
@@ -52,10 +54,10 @@ int main(int argc, char *argv[])
 
 	// Command line long options.
 	struct option opts[] = {
-		{"mode",	required_argument, 0, 'm'},
-		{"test",	no_argument,	   0, 't'},
-		{"help",	no_argument,	   0, 'h'},
-		{0, 		0, 		   0, 0}
+		{ "mode",	required_argument,	0,	'm' },
+		{ "test",	no_argument,		0,	't' },
+		{ "help",	no_argument,		0,	'h' },
+		{ 0, 		0, 			0,	0 }
 	};
 
 	// Command line options processing.
@@ -67,7 +69,9 @@ int main(int argc, char *argv[])
 		case 't':
 			test = 1;
 			break;
-		case 'h': // Fall through.
+		case 'h':
+			help();
+			return EXIT_SUCCESS;
 		default:
 			help();
 			return EXIT_FAILURE;
@@ -83,37 +87,37 @@ int main(int argc, char *argv[])
 			return EXIT_FAILURE;
 		}
 
-		zone_file = argv[optind];
-		origin = argv[optind + 1];
+		origin = argv[optind];
+		zone_file = argv[optind + 1];
 
 		// Create appropriate file loader.
 		switch (mode) {
 		case 0:
-			fl = file_loader_create(origin,
-						zone_file,
-						DEFAULT_CLASS,
-						DEFAULT_TTL,
-						&empty_process,
-						&empty_process,
-						NULL);
+			fl = file_loader_create(zone_file,
+			                        origin,
+			                        DEFAULT_CLASS,
+			                        DEFAULT_TTL,
+			                        NULL,
+			                        NULL,
+			                        NULL);
 			break;
 		case 1:
-			fl = file_loader_create(origin,
-						zone_file,
-						DEFAULT_CLASS,
-						DEFAULT_TTL,
-						&debug_process_record,
-						&debug_process_error,
-						NULL);
+			fl = file_loader_create(zone_file,
+			                        origin,
+			                        DEFAULT_CLASS,
+			                        DEFAULT_TTL,
+			                        &debug_process_record,
+			                        &debug_process_error,
+			                        NULL);
 			break;
 		case 2:
-			fl = file_loader_create(origin,
-						zone_file,
-						DEFAULT_CLASS,
-						DEFAULT_TTL,
-						&test_process_record,
-						&test_process_error,
-						NULL);
+			fl = file_loader_create(zone_file,
+			                        origin,
+			                        DEFAULT_CLASS,
+			                        DEFAULT_TTL,
+			                        &test_process_record,
+			                        &test_process_error,
+			                        NULL);
 			break;
 		default:
 			printf("Bad mode number!\n");