[hamradio-commits] [xnec2c] 03/05: Imported Upstream version 3.3

Dave Hibberd hibby-guest at moszumanska.debian.org
Mon May 4 19:51:52 UTC 2015


This is an automated email from the git hooks/post-receive script.

hibby-guest pushed a commit to branch master
in repository xnec2c.

commit e5dd6e48901d3252c6ca5b1712d3f9693795a322
Author: Dave Hibberd <d at vehibberd.com>
Date:   Mon May 4 18:42:46 2015 +0100

    Imported Upstream version 3.3
---
 Makefile.in                               |  44 ++--
 aclocal.m4                                |  94 +++-----
 autogen.sh                                |  13 +-
 configure                                 | 207 +++++++----------
 configure.ac                              |   2 +-
 depcomp                                   |   2 +-
 doc/xnec2c.html                           |  78 ++++---
 examples/10-30m_bipyramid.nec             |   4 +-
 examples/10-30m_inv_cone.nec              |  15 ++
 examples/10-30m_sphere.nec                |   2 +-
 examples/10-30m_vert.nec                  |   1 +
 examples/10-80m_G5RV.nec                  |  10 +-
 examples/10-80m_Inverted-L.nec            |   4 +-
 examples/10-80m_windom.nec                |  15 +-
 examples/137MHz_turnstile-sloped.nec      |   3 +-
 examples/137MHz_turnstile.nec             |   3 +-
 examples/13cm_Yagi.nec                    |   2 +-
 examples/13cm_corner_reflector.nec        |   2 +-
 examples/13cm_helix+screen.nec            |   3 +-
 examples/15m_delta-loop.nec               |   2 +-
 examples/1MHz_3x_helicone.nec             |   3 +-
 examples/1MHz_3x_helisphere.nec           |  23 +-
 examples/1MHz_4x_helisphere.nec           |  23 +-
 examples/1MHz_helivert.nec                |  15 +-
 examples/1MHz_tower.nec                   |   3 +-
 examples/20-40m_ground_plane.nec          |   3 +-
 examples/20-40m_vert_circ_cliff.nec       |   3 +-
 examples/20-40m_vert_linear_cliff.nec     |   3 +-
 examples/20-40m_vert_sommerfeld_cliff.nec |   3 +-
 examples/20m_car_ant.nec                  |   3 +-
 examples/20m_quad.nec                     |   2 +-
 examples/23cm_helix+radials.nec           |   3 +-
 examples/23cm_helix+screen.nec            |   3 +-
 examples/2m_1:4l-gp_on_pole.nec           |   2 +-
 examples/2m_5:8l-gp_on_pole.nec           |   2 +-
 examples/2m_EME_ant.nec                   |   2 +-
 examples/2m_bigwheel.nec                  |   2 +-
 examples/2m_extended_Xpol_yagi.nec        |  13 ++
 examples/2m_extended_yagi.nec             |  11 +
 examples/2m_halo_stack.nec                |   2 +-
 examples/2m_sqr_halo.nec                  |   2 +-
 examples/2m_sqr_halo_stack.nec            |   2 +-
 examples/2m_xpol_omni.nec                 |   1 +
 examples/2m_xpol_omni_stack.nec           |   3 +-
 examples/2m_yagi.nec                      |   3 +-
 examples/30-80m_inv_L.nec                 |  11 +-
 examples/35-55MHz_logper.nec              |   3 +-
 examples/40m-moxon.nec                    |   2 +-
 examples/6-17m_bipyramid.nec              |   2 +-
 examples/6-20m_inv_cone.nec               |   2 +-
 examples/6m_big-square_stack.nec          |   2 +-
 examples/6m_bigwheel-stack.nec            |   2 +-
 examples/70cm_collinear.nec               |   3 +-
 examples/80m_zepp.nec                     |   2 +-
 examples/T12m-H24m.nec                    |   3 +-
 examples/T20m-H18m.nec                    |   2 +-
 examples/airplane.nec                     |   3 +-
 examples/buoy.nec                         |   5 +-
 examples/conductivity.txt                 |  16 +-
 examples/gray_hoverman.nec                |   3 +-
 examples/k9ay_5b4az.nec                   |   2 +-
 examples/k9ay_orig.nec                    |   2 +-
 examples/satellite.nec                    |   3 +-
 install-sh                                | 366 ++++++++++++++----------------
 missing                                   |   2 +-
 po/Makefile.in.in                         |  11 +-
 src/Makefile.am                           |   3 +
 src/Makefile.in                           |  27 ++-
 src/calculations.c                        |  28 +--
 src/callback_func.c                       | 189 ++++++++++-----
 src/callbacks.c                           | 228 ++++++++++++++-----
 src/cmnd_edit.c                           |   6 +-
 src/common.h                              |   8 +-
 src/draw_radiation.c                      | 172 +++++++-------
 src/draw_structure.c                      |  35 ++-
 src/fields.c                              |   5 +-
 src/fork.c                                |   8 +-
 src/geom_edit.c                           |   6 +-
 src/geometry.c                            | 320 +++++++++++++-------------
 src/gnuplot.c                             |  14 +-
 src/ground.c                              |  16 +-
 src/input.c                               | 187 +++++++--------
 src/interface.c                           |  17 +-
 src/main.c                                |  27 ++-
 src/matrix.c                              |  20 +-
 src/nec2_model.c                          |  11 +-
 src/network.c                             |  50 ++--
 src/plot_freqdata.c                       |  41 ++--
 src/radiation.c                           |  19 +-
 src/shared.c                              |  10 +-
 src/shared.h                              |  10 +-
 src/somnec.c                              |  62 ++---
 src/utils.c                               |  32 ++-
 src/xnec2c.c                              |   5 +-
 xnec2c.glade                              |  20 +-
 95 files changed, 1432 insertions(+), 1232 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 694eca8..830ae4b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -76,14 +86,12 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
-	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/configure $(am__configure_deps) \
-	$(srcdir)/config.h.in COPYING compile install-sh missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+	$(am__configure_deps) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
@@ -147,6 +155,9 @@ ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
+	COPYING ChangeLog INSTALL NEWS README compile install-sh \
+	missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -354,7 +365,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -579,15 +589,15 @@ dist-xz: distdir
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
-	@echo WARNING: "Support for shar distribution archives is" \
-	               "deprecated." >&2
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
-	@echo WARNING: "Support for distribution archives compressed with" \
-		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
@@ -623,17 +633,17 @@ distcheck: dist
 	esac
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_inst
+	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure \
+	  && $(am__cd) $(distdir)/_build/sub \
+	  && ../../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
-	    --srcdir=.. --prefix="$$dc_install_base" \
+	    --srcdir=../.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -809,6 +819,8 @@ uninstall-am:
 	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
 	tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 install-data-local:
 	@$(NORMAL_INSTALL)
diff --git a/aclocal.m4 b/aclocal.m4
index 26055c7..d445a26 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -590,31 +590,6 @@ fi
 # Substitute ALL_LINGUAS so we can use it in po/Makefile
 AC_SUBST(ALL_LINGUAS)
 
-# Set DATADIRNAME correctly if it is not set yet
-# (copied from glib-gettext.m4)
-if test -z "$DATADIRNAME"; then
-  AC_LINK_IFELSE(
-    [AC_LANG_PROGRAM([[]],
-                     [[extern int _nl_msg_cat_cntr;
-                       return _nl_msg_cat_cntr]])],
-    [DATADIRNAME=share],
-    [case $host in
-    *-*-solaris*)
-    dnl On Solaris, if bind_textdomain_codeset is in libc,
-    dnl GNU format message catalog is always supported,
-    dnl since both are added to the libc all together.
-    dnl Hence, we'd like to go with DATADIRNAME=share
-    dnl in this case.
-    AC_CHECK_FUNC(bind_textdomain_codeset,
-      [DATADIRNAME=share], [DATADIRNAME=lib])
-    ;;
-    *)
-    [DATADIRNAME=lib]
-    ;;
-    esac])
-fi
-AC_SUBST(DATADIRNAME)
-
 IT_PO_SUBDIR([po])
 
 ])
@@ -672,7 +647,7 @@ AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
 
 
 # nls.m4 serial 5 (gettext-0.18)
-dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -919,7 +894,7 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
 AS_VAR_IF([$1], [""], [$5], [$4])dnl
 ])# PKG_CHECK_VAR
 
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -931,10 +906,10 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.15], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -950,14 +925,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1002,15 +977,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 ])
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1041,7 +1015,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1232,7 +1206,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1308,7 +1282,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1398,8 +1372,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -1472,7 +1446,11 @@ to "yes", and re-run configure.
 END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -1501,7 +1479,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1512,7 +1490,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -1522,7 +1500,7 @@ if test x"${install_sh}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1544,7 +1522,7 @@ AC_SUBST([am__leading_dot])])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1579,7 +1557,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1629,7 +1607,7 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1668,7 +1646,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1697,7 +1675,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1744,7 +1722,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1763,7 +1741,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1844,7 +1822,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1904,7 +1882,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1932,7 +1910,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1951,7 +1929,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/autogen.sh b/autogen.sh
index befe42a..0be28e8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -349,12 +349,13 @@ case $REQUIRED_AUTOMAKE_VERSION in
     1.6*) automake_progs="automake-1.13 automake-1.12 automake-1.11 automake-1.10 automake-1.9 automake-1.8 automake-1.7 automake-1.6" ;;
     1.7*) automake_progs="automake-1.13 automake-1.12 automake-1.11 automake-1.10 automake-1.9 automake-1.8 automake-1.7" ;;
     1.8*) automake_progs="automake-1.13 automake-1.12 automake-1.11 automake-1.10 automake-1.9 automake-1.8" ;;
-    1.9*) automake_progs="automake-1.14 automake-1.13 automake-1.12 automake-1.11 automake-1.10 automake-1.9" ;;
-    1.10*) automake_progs="automake-1.14 automake-1.13 automake-1.12 automake-1.11 automake-1.10" ;;
-    1.11*) automake_progs="automake-1.14 automake-1.13 automake-1.12 automake-1.11" ;;
-    1.12*) automake_progs="automake-1.14 automake-1.13 automake-1.12" ;;
-    1.13*) automake_progs="automake-1.14 automake-1.13" ;;
-    1.14*) automake_progs="automake-1.14 " ;;
+    1.9*) automake_progs="automake-1.15 automake-1.14 automake-1.13 automake-1.12 automake-1.11 automake-1.10 automake-1.9" ;;
+    1.10*) automake_progs="automake-1.15 automake-1.14 automake-1.13 automake-1.12 automake-1.11 automake-1.10" ;;
+    1.11*) automake_progs="automake-1.15 automake-1.14 automake-1.13 automake-1.12 automake-1.11" ;;
+    1.12*) automake_progs="automake-1.15 automake-1.14 automake-1.13 automake-1.12" ;;
+    1.13*) automake_progs="automake-1.15 automake-1.14 automake-1.13" ;;
+    1.14*) automake_progs="automake-1.15 automake-1.14 " ;;
+    1.15*) automake_progs="automake-1.15 " ;;
 esac
 version_check automake AUTOMAKE "$automake_progs" $REQUIRED_AUTOMAKE_VERSION \
     "http://ftp.gnu.org/pub/gnu/automake/automake-$REQUIRED_AUTOMAKE_VERSION.tar.gz"
diff --git a/configure b/configure
index 4bf60c7..aa06ba3 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xnec2c 3.0.
+# Generated by GNU Autoconf 2.69 for xnec2c 3.3.
 #
 # Report bugs to <nkcyham at yahoo.com>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='xnec2c'
 PACKAGE_TARNAME='xnec2c'
-PACKAGE_VERSION='3.0'
-PACKAGE_STRING='xnec2c 3.0'
+PACKAGE_VERSION='3.3'
+PACKAGE_STRING='xnec2c 3.3'
 PACKAGE_BUGREPORT='nkcyham at yahoo.com'
 PACKAGE_URL=''
 
@@ -635,6 +635,7 @@ PO_IN_DATADIR_TRUE
 INTLLIBS
 INSTOBJEXT
 GMOFILES
+DATADIRNAME
 CATOBJEXT
 CATALOGS
 MSGFMT_OPTS
@@ -642,7 +643,6 @@ EGREP
 GREP
 CPP
 GETTEXT_PACKAGE
-DATADIRNAME
 ALL_LINGUAS
 INTLTOOL_PERL
 GMSGFMT
@@ -1339,7 +1339,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures xnec2c 3.0 to adapt to many kinds of systems.
+\`configure' configures xnec2c 3.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1405,7 +1405,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of xnec2c 3.0:";;
+     short | recursive ) echo "Configuration of xnec2c 3.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1511,7 +1511,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-xnec2c configure 3.0
+xnec2c configure 3.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1647,73 +1647,6 @@ fi
 
 } # ac_fn_c_try_link
 
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
 # ac_fn_c_try_cpp LINENO
 # ----------------------
 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -1915,6 +1848,73 @@ $as_echo "$ac_res" >&6; }
 
 } # ac_fn_c_check_header_compile
 
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
 # -------------------------------------------
 # Tests whether TYPE exists after having included INCLUDES, setting cache
@@ -1972,7 +1972,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by xnec2c $as_me 3.0, which was
+It was created by xnec2c $as_me 3.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2320,7 +2320,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-am__api_version='1.14'
+am__api_version='1.15'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2521,8 +2521,8 @@ test "$program_suffix" != NONE &&
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 if test x"${MISSING+set}" != xset; then
   case $am_aux_dir in
@@ -2541,7 +2541,7 @@ else
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -2835,7 +2835,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='xnec2c'
- VERSION='3.0'
+ VERSION='3.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2869,8 +2869,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 # Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
@@ -2928,6 +2928,7 @@ END
   fi
 fi
 
+
 ac_config_headers="$ac_config_headers config.h"
 
 
@@ -5224,44 +5225,6 @@ fi
 # Substitute ALL_LINGUAS so we can use it in po/Makefile
 
 
-# Set DATADIRNAME correctly if it is not set yet
-# (copied from glib-gettext.m4)
-if test -z "$DATADIRNAME"; then
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-extern int _nl_msg_cat_cntr;
-                       return _nl_msg_cat_cntr
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  DATADIRNAME=share
-else
-  case $host in
-    *-*-solaris*)
-                        ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
-if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
-  DATADIRNAME=share
-else
-  DATADIRNAME=lib
-fi
-
-    ;;
-    *)
-    DATADIRNAME=lib
-    ;;
-    esac
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-
-
 
 
 
@@ -8055,7 +8018,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by xnec2c $as_me 3.0, which was
+This file was extended by xnec2c $as_me 3.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8121,7 +8084,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-xnec2c config.status 3.0
+xnec2c config.status 3.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 92f0e9f..501e183 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.69])
-AC_INIT([xnec2c], [3.0], [nkcyham at yahoo.com])
+AC_INIT([xnec2c], [3.3], [nkcyham at yahoo.com])
 AM_INIT_AUTOMAKE
 AC_CONFIG_SRCDIR([src/common.h])
 AC_CONFIG_HEADERS([config.h])
diff --git a/depcomp b/depcomp
index 4ebd5b3..fc98710 100755
--- a/depcomp
+++ b/depcomp
@@ -3,7 +3,7 @@
 
 scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/doc/xnec2c.html b/doc/xnec2c.html
index e1501c2..7d1ae9e 100644
--- a/doc/xnec2c.html
+++ b/doc/xnec2c.html
@@ -21,39 +21,39 @@
 translation of NEC2</h4>
 </div>
 <ol>
-<li><b><a href="#Introduction">Introduction</a></b></li>
-<li><b><a href="#Features">Features</a></b>
+<li><a href="#Introduction">Introduction</a></li>
+<li><a href="#Features">Features</a></b>
 <ul>
-<li><b><a href="#Interactive">Interactive Operation</a></b></li>
-<li><b><a href="#NoOutFile">No Output File</a></b></li>
-<li><b><a href="#Windows">Windows</a></b></li>
-<li><b><a href="#Color">Color Coding</a></b></li>
-<li><b><a href="#OnDemand">On-demand Calculation</a></b></li>
-<li><b><a href="#Multithread">Multi-threaded operation on SMP
-machines</a></b></li>
-<li><b><a href="#Nec2Edit">Built-in NEC2 input file
-editor</a></b></li>
+<li><a href="#Interactive">Interactive Operation</a></li>
+<li><a href="#NoOutFile">No Output File</a></li>
+<li><a href="#Windows">Windows</a></li>
+<li><a href="#Color">Color Coding</a></li>
+<li><a href="#OnDemand">On-demand Calculation</a></li>
+<li><a href="#Multithread">Multi-threaded operation on SMP
+machines</a></li>
+<li><a href="#Nec2Edit">Built-in NEC2 input file
+editor</a></li>
 </ul>
 </li>
-<li><b><a href="#Limitations">Limitations</a></b></li>
-<li><b><a href="#Compilation">Compilation and
-Installation</a></b></li>
-<li><b><a href="#Operation">Operation</a></b>
+<li><a href="#Limitations">Limitations</a></li>
+<li><a href="#Compilation">Compilation and
+Installation</a></li>
+<li><a href="#Operation">Operation</a></b>
 <ul>
-<li><b><a href="#CommandLine">Command Line Options</a></b></li>
-<li><b><a href="#MainWindow">The Main Window</a></b></li>
-<li><b><a href="#RadiationWindow">The Radiation Pattern
-Window</a></b></li>
-<li><b><a href="#FrequencyWindow">Frequency Data Plots</a></b></li>
-<li><b><a href="#Nec2Treeview">NEC2 Input File Editor</a></b></li>
+<li><a href="#CommandLine">Command Line Options</a></li>
+<li><a href="#MainWindow">The Main Window</a></li>
+<li><a href="#RadiationWindow">The Radiation Pattern
+Window</a></li>
+<li><a href="#FrequencyWindow">Frequency Data Plots</a></li>
+<li><a href="#Nec2Treeview">NEC2 Input File Editor</a></li>
 </ul>
 </li>
-<li><b><a href="#InputFile">Input File Considerations</a></b></li>
-<li><b><a href="#OutputFile">Output File
-Considerations</a></b></li>
-<li><b><a href="#Version">Version History</a></b></li>
-<li><b><a href="#Bugs">Bugs and Inadequacies</a></b></li>
-<li><b><a href="#Acknowledgement">Acknowledgment</a></b></li>
+<li><a href="#InputFile">Input File Considerations</a></li>
+<li><a href="#OutputFile">Output File
+Considerations</a></li>
+<li><a href="#Version">Version History</a></li>
+<li><a href="#Bugs">Bugs and Inadequacies</a></li>
+<li><a href="#Acknowledgement">Acknowledgment</a></li>
 </ol>
 <b><a name="Introduction" id="Introduction">1.
 Introduction:</a></b><br>
@@ -912,12 +912,30 @@ GN card, was opened after a .nec file, with a Radial Ground
 Screen specified in the GN card, was processed.<p/>
 <p><b>Version 2.9:</b> After a request by the Debian maintainer
 of xnec2c, I added a rudimentary man page he sent me and
-corrected some spelling errors (arbitary to arbitrary).<p/>
+corrected some spelling errors (arbitrary to arbitrary).<p/>
 <p><b>Version 3.0:</b> I have modified the NEC2 file parser so
-that it can read the file with both the '.' and ',' decimal point
-characters. This is necessary to make xnec2c compatible with
+that it can read the file with both the '.' and ',' as decimal
+point characters. This is necessary to make xnec2c compatible with
 different locales. I also fixed a resource (memory) leak, reported
 by valgrind, in the xyz axes drawing routine.<p/>
+<p><b>Version 3.1:</b> I have made several changes to the code
+that renders wire frame drawings and displays some data, like the
+projection parameters (azimuth and elevation of the structure and
+the radiation pattern) and gain values. This has resulted in a
+faster and smoother animation of these drawings and reduced
+workload on the processor during dragging of these images.<br>
+I have also reduced the default minimum size of xnec2c's windows,
+as I had reports that they would not fit in the displays of some
+laptops or monitors, with resolutions on the lower side.<p/>
+<p><b>Version 3.2:</b> I made some changes to the Strlcat()
+function and its usage in the xnec2c code, to improve safe
+handling of string concatenation operations. Hopefully this has
+not broken the handling of various strings in xnec2c! ;-)</p>
+<p><b>Version 3.3:</b> I fixed a bug that was in the code that
+reads the commands from the NEC2 input file, where xnec2c would
+crash with a segmentation fault when the FR card was after the
+RP card. Also modified the Strtod() function to avoid freeing the
+end pointer before it was used, causing problems.</p>
 <p><b><a name="Bugs" id="Bugs">9. Bugs and Inadequacies:</a></b><br>
 Xnec2c is based on nec2c, my translation to C of the original
 FORTRAN NEC2 code. Any bugs discovered in nec2c will affect xnec2c
diff --git a/examples/10-30m_bipyramid.nec b/examples/10-30m_bipyramid.nec
index c1167f3..ef548a3 100644
--- a/examples/10-30m_bipyramid.nec
+++ b/examples/10-30m_bipyramid.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Skeleton bi-pyramid antenna for 10-30 MHz
 CE --- End Comments ---
 GW     1    18  2.40000E+00  0.00000E+00  2.90000E+00  0.00000E+00  0.00000E+00  2.00000E-01  3.00000E-03
@@ -13,6 +13,6 @@ EX     0     7     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 FR     0    41     0      0  1.00000E+01  5.00000E-01  3.00000E+01  0.00000E+00  0.00000E+00  0.00000E+00
 NH     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 NE     0    10     1     10 -4.50000E+00  0.00000E+00  5.00000E-01  1.00000E+00  0.00000E+00  1.00000E+00
-RP     4    19    37     0  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+RP     4    19    37   1000  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
 GN     0    32     0      0  1.20000E+01  1.00000E-02  7.50000E+00  4.00000E-03  0.00000E+00  0.00000E+00
 EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/10-30m_inv_cone.nec b/examples/10-30m_inv_cone.nec
new file mode 100644
index 0000000..b4c52e7
--- /dev/null
+++ b/examples/10-30m_inv_cone.nec
@@ -0,0 +1,15 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
+CM Skeleton bi-pyramid antenna for 14-52 MHz
+CE --- End Comments ---
+GW     1    25  0.00000E+00  0.00000E+00  1.90400E-01  1.80200E+00  0.00000E+00  5.10000E+00  1.00000E-03
+GW     2     9  9.01000E-01  1.56060E+00  5.10000E+00  1.80200E+00  0.00000E+00  5.10000E+00  1.00000E-03
+GW     3     9  0.00000E+00  0.00000E+00  5.10000E+00  1.80200E+00  0.00000E+00  5.10000E+00  3.00000E-03
+GR     0     6  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+GW     4     1  0.00000E+00  0.00000E+00  1.90400E-01  0.00000E+00  0.00000E+00  0.00000E+00  1.25000E-02
+GW     5    25  0.00000E+00  0.00000E+00  1.90400E-01  0.00000E+00  0.00000E+00  5.10000E+00  1.25000E-02
+GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+EX     0     4     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+FR     0    41     0      0  1.00000E+01  5.00000E-01  3.00000E+01  0.00000E+00  0.00000E+00  0.00000E+00
+RP     4    19    37      0  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+GN     1     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/10-30m_sphere.nec b/examples/10-30m_sphere.nec
index 3afde25..386270f 100644
--- a/examples/10-30m_sphere.nec
+++ b/examples/10-30m_sphere.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 0.6-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Skeleton spherical broadband vertical for 10-30 MHz
 CM Average ground with radial wire screen
 CE --- End Comments ---
diff --git a/examples/10-30m_vert.nec b/examples/10-30m_vert.nec
index 1067412..c98b2ce 100644
--- a/examples/10-30m_vert.nec
+++ b/examples/10-30m_vert.nec
@@ -1,3 +1,4 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Skeleton Cage broad-band vertical 10-30 MHz
 CM Average ground with radial wire screen and cliff
 CE --- End Comments ---
diff --git a/examples/10-80m_G5RV.nec b/examples/10-80m_G5RV.nec
index 7a097c3..74ed695 100644
--- a/examples/10-80m_G5RV.nec
+++ b/examples/10-80m_G5RV.nec
@@ -1,12 +1,12 @@
-CM --- NEC2 Input File created by xnec2c-1.5 ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM G5RV antenna for 10 - 80m
 CE --- End Comments ---
-GW     1    61  1.55500E+01  0.00000E+00  9.65000E+00 -1.55500E+01  0.00000E+00  9.65000E+00  2.00000E-03
-GW     2     1  2.00000E-01  0.00000E+00  2.00000E-01 -2.00000E-01  0.00000E+00  2.00000E-01  1.50000E-02
-GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+GW     1    61   1.55500E+01  0.00000E+00  9.65000E+00 -1.55500E+01  0.00000E+00  9.65000E+00  2.00000E-03
+GW     2     1   2.00000E-01  0.00000E+00  2.00000E-01 -2.00000E-01  0.00000E+00  2.00000E-01  1.50000E-02
+GE     1     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     2     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 FR     0    55     0      0  3.00000E+00  5.00000E-01  3.00000E+01  0.00000E+00  0.00000E+00  0.00000E+00
-RP     0    19    37      0  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+RP     0    37    74   1000  0.00000E+00  0.00000E+00  2.50000E+00  5.00000E+00  0.00000E+00  0.00000E+00
 TL     1    31     2      1  4.50000E+02  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 GN     2     0     0      0  1.20000E+01  1.00000E-02  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/10-80m_Inverted-L.nec b/examples/10-80m_Inverted-L.nec
index d30eafd..d530fbf 100644
--- a/examples/10-80m_Inverted-L.nec
+++ b/examples/10-80m_Inverted-L.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c-1.6 ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Inverted L antenna for 10 - 80m
 CE --- End Comments ---
 GW     1    21  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  9.00000E+00  2.00000E-03
@@ -6,6 +6,6 @@ GW     2    62  0.00000E+00  0.00000E+00  9.00000E+00  2.50000E+01  0.00000E+00
 GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     1     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 FR     0    55     0      0  3.00000E+00  5.00000E-01  3.00000E+01  0.00000E+00  0.00000E+00  0.00000E+00
-RP     0    19    37      0  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+RP     0    19    37   1000  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
 GN     0     4     0      0  1.20000E+01  5.00000E-03  8.00000E+00  5.00000E-03  0.00000E+00  0.00000E+00
 EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/10-80m_windom.nec b/examples/10-80m_windom.nec
index f6efc39..c5b6b89 100644
--- a/examples/10-80m_windom.nec
+++ b/examples/10-80m_windom.nec
@@ -1,12 +1,11 @@
-CM --- NEC2 Input File created by xnec2c-1.6 ---
-CM Windom antenna for 10 - 80m
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CE --- End Comments ---
-GW     1    16  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  8.00000E+00  2.00000E-03
-GW     2    27  0.00000E+00  0.00000E+00  8.00000E+00  1.36000E+01  0.00000E+00  8.00000E+00  2.00000E-03
-GW     3    13  0.00000E+00  0.00000E+00  8.00000E+00 -6.80000E+00  0.00000E+00  8.00000E+00  2.00000E-03
-GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+GW     1    60   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.20000E+01  1.25000E-03
+GW     2    65  0.00000E+00  0.00000E+00  1.20000E+01 -1.45000E+01  0.00000E+00  1.20000E+01  1.25000E-03
+GW     3   130   0.00000E+00  0.00000E+00  1.20000E+01  2.70000E+01  0.00000E+00  1.20000E+01  1.25000E-03
+GE     1     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     1     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 FR     0    55     0      0  3.00000E+00  5.00000E-01  3.00000E+01  0.00000E+00  0.00000E+00  0.00000E+00
-RP     0    19    37      0  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
-GN     0     4     0      0  1.20000E+01  1.00000E-02  8.00000E+00  5.00000E-03  0.00000E+00  0.00000E+00
+RP     0    19    37   1000  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+GN     0    16     0      0  1.20000E+01  1.00000E-02  1.00000E+01  5.00000E-03  0.00000E+00  0.00000E+00
 EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/137MHz_turnstile-sloped.nec b/examples/137MHz_turnstile-sloped.nec
index e3cc1cb..f942a1e 100644
--- a/examples/137MHz_turnstile-sloped.nec
+++ b/examples/137MHz_turnstile-sloped.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM R.H. cicular polarized turnstile for 137 MHz
-CE End Comments
+CE --- End Comments ---
 GW     1    24  0.00000E+00 -4.90000E-01  1.00000E-01  0.00000E+00  4.90000E-01  1.00000E-01  6.00000E-03
 GW     2    24 -4.85000E-01  0.00000E+00  1.00000E-01  4.85000E-01  0.00000E+00  1.00000E-01  6.00000E-03
 GW     3    12  0.00000E+00  1.00000E-02  5.00000E-01  3.30000E-01  1.00000E-02  1.63000E-01  6.00000E-03
diff --git a/examples/137MHz_turnstile.nec b/examples/137MHz_turnstile.nec
index cc787d4..e9f3379 100644
--- a/examples/137MHz_turnstile.nec
+++ b/examples/137MHz_turnstile.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Turnstile antenna RH elliptical polarization for 137 MHz
-CE End Comments
+CE --- End Comments ---
 GW     1    24  0.00000E+00  5.20000E-01  1.05450E-01  0.00000E+00 -5.20000E-01  1.05450E-01  6.00000E-03
 GW     2    24 -5.20000E-01  0.00000E+00  1.05450E-01  5.20000E-01  0.00000E+00  1.05450E-01  6.00000E-03
 GW     3    12 -5.15000E-01  1.00000E-02  4.21000E-01  0.00000E+00  1.00000E-02  4.21000E-01  6.00000E-03
diff --git a/examples/13cm_Yagi.nec b/examples/13cm_Yagi.nec
index 2af4c5a..06f1a96 100644
--- a/examples/13cm_Yagi.nec
+++ b/examples/13cm_Yagi.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c-1.6 ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Yagi antenna for 2.4 GHz
 CE --- End Comments ---
 GW     1    23  0.00000E+00  0.00000E+00 -2.62500E-02  0.00000E+00  0.00000E+00  2.62500E-02  1.50000E-03
diff --git a/examples/13cm_corner_reflector.nec b/examples/13cm_corner_reflector.nec
index 83b6745..a41d91b 100644
--- a/examples/13cm_corner_reflector.nec
+++ b/examples/13cm_corner_reflector.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c-1.4 ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Corner reflector for 2.4 GHz
 CE --- End Comments ---
 GW     1    13  1.00000E-02  0.00000E+00  2.25000E-02  1.00000E-02  0.00000E+00 -2.25000E-02  1.50000E-03
diff --git a/examples/13cm_helix+screen.nec b/examples/13cm_helix+screen.nec
index d4ba7d7..996b333 100644
--- a/examples/13cm_helix+screen.nec
+++ b/examples/13cm_helix+screen.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  Helix and screen reflector for 2400 MHz
-CE End Comments
+CE --- End Comments ---
 GH     1   507  3.34700E-02  5.30000E-01  2.15900E-02  2.15900E-02  2.15900E-02  2.15900E-02  1.50000E-03
 GM     0     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.50600E-02  0.00000E+00
 GW     2     7  0.00000E+00  0.00000E+00  0.00000E+00  2.15800E-02  0.00000E+00  1.50600E-02  1.50000E-03
diff --git a/examples/15m_delta-loop.nec b/examples/15m_delta-loop.nec
index 27499de..b814014 100644
--- a/examples/15m_delta-loop.nec
+++ b/examples/15m_delta-loop.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM 3 Element Delta Loop beam for 15m
 CM NOTE: This input file uses the modified GS command available
 CM in xnec2c, where scaling is specified for a range of tag
diff --git a/examples/1MHz_3x_helicone.nec b/examples/1MHz_3x_helicone.nec
index f641754..80fda29 100644
--- a/examples/1MHz_3x_helicone.nec
+++ b/examples/1MHz_3x_helicone.nec
@@ -1,7 +1,8 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Top-loaded helical vertical for 1.0 MHz, over perfect ground.
 CM Three helices are used in parallel to raise the input impedance
 CM to near 50 Ohms. The top hat is conical to add to radiation.
-CE End Comments
+CE --- End Comments ---
 GW     1    20  0.00000E+00  0.00000E+00  1.35000E+01  1.07000E+01  0.00000E+00  1.90000E+01  3.00000E-02
 GW     1     7  1.07000E+01  0.00000E+00  1.90000E+01  9.88550E+00  4.09470E+00  1.90000E+01  3.00000E-02
 GR     0    16  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/1MHz_3x_helisphere.nec b/examples/1MHz_3x_helisphere.nec
index 0c7cb4c..04314f2 100644
--- a/examples/1MHz_3x_helisphere.nec
+++ b/examples/1MHz_3x_helisphere.nec
@@ -1,18 +1,19 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Top-loaded helical vertical for 1.0 MHz, over perfect ground.
 CM Three helices are used in parallel to raise the input impedance
 CM to near 50 Ohms. The top hat is spherical to add to radiation.
-CE End Comments
-GA     1    32  7.00000E+00 -9.00000E+01  9.00000E+01  3.00000E-02  2.52150E-01  0.00000E+00  0.00000E+00
-GR     0    16  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
-GM     0     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.78000E+01  1.00000E+00
-GH     2   120  1.03000E+00  1.03000E+01  1.15000E+00  1.15000E+00  1.15000E+00  1.15000E+00  3.00000E-02
-GM     0     0  0.00000E+00  0.00000E+00  0.00000E+00 -3.00000E+00  0.00000E+00  0.00000E+00  2.00000E+00
-GW     3     3 -1.85000E+00  0.00000E+00  1.03000E+01  0.00000E+00  0.00000E+00  1.03000E+01  3.00000E-02
-GM     0     2  0.00000E+00  0.00000E+00  1.20000E+02  0.00000E+00  0.00000E+00  0.00000E+00  2.00000E+00
-GW     4     1  0.00000E+00  0.00000E+00  1.03000E+01  0.00000E+00  0.00000E+00  1.08000E+01  5.00000E-02
-GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+CE --- End Comments ---
+GA     1    32   7.00000E+00 -9.00000E+01  9.00000E+01  3.00000E-02  2.52150E-01  0.00000E+00  0.00000E+00
+GR     0    16   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+GM     0     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.78000E+01  1.00000E+00
+GH     2   120   1.03000E+00  1.03000E+01  1.15000E+00  1.15000E+00  1.15000E+00  1.15000E+00  3.00000E-02
+GM     0     0   0.00000E+00  0.00000E+00  0.00000E+00 -3.00000E+00  0.00000E+00  0.00000E+00  2.00000E+00
+GW     3     3  -1.85000E+00  0.00000E+00  1.03000E+01  0.00000E+00  0.00000E+00  1.03000E+01  3.00000E-02
+GM     0     2   0.00000E+00  0.00000E+00  1.20000E+02  0.00000E+00  0.00000E+00  0.00000E+00  2.00000E+00
+GW     4     1   0.00000E+00  0.00000E+00  1.03000E+01  0.00000E+00  0.00000E+00  1.08000E+01  5.00000E-02
+GE     1     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 GN     1     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+FR     0    41     0      0  9.00000E-01  5.00000E-03  1.10000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     2     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 RP     0    19    37   1000  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
-FR     0    41     0      0  9.00000E-01  5.00000E-03  1.10000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/1MHz_4x_helisphere.nec b/examples/1MHz_4x_helisphere.nec
index 1f05633..fd13be2 100644
--- a/examples/1MHz_4x_helisphere.nec
+++ b/examples/1MHz_4x_helisphere.nec
@@ -1,17 +1,18 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Top-loaded helical vertical for 1.0 MHz, over perfect ground. Four
 CM co-axial helices are used in parallel to raise the input impedance
 CM to near 50 Ohms. The top hat is spherical to add to radiation.
-CE End Comments
-GA     1    20  5.00000E+00 -9.00000E+01  9.00000E+01  3.00000E-02  2.88171E-01  0.00000E+00  0.00000E+00
-GR     0    16  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
-GM     0     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.37000E+01  1.00000E+00
-GH     2    80  1.02500E+00  8.20000E+00  1.16500E+00  1.16500E+00  1.16500E+00  1.16500E+00  3.00000E-02
-GW     3     2  0.00000E+00  0.00000E+00  8.20000E+00  1.16500E+00  0.00000E+00  8.20000E+00  3.00000E-02
-GM     0     3  0.00000E+00  0.00000E+00  9.00000E+01  0.00000E+00  0.00000E+00  0.00000E+00  2.00000E+00
-GW     4     1  0.00000E+00  0.00000E+00  8.20000E+00  0.00000E+00  0.00000E+00  8.70000E+00  5.00000E-02
-GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
-GN     0     0     0     0  1.20000E+01  5.00000E-03  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+CE --- End Comments ---
+GA     1    20   5.00000E+00 -9.00000E+01  9.00000E+01  3.00000E-02  2.88171E-01  0.00000E+00  0.00000E+00
+GR     0    16   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+GM     0     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.37000E+01  1.00000E+00
+GH     2    80   1.02500E+00  8.20000E+00  1.16500E+00  1.16500E+00  1.16500E+00  1.16500E+00  3.00000E-02
+GW     3     2   0.00000E+00  0.00000E+00  8.20000E+00  1.16500E+00  0.00000E+00  8.20000E+00  3.00000E-02
+GM     0     3   0.00000E+00  0.00000E+00  9.00000E+01  0.00000E+00  0.00000E+00  0.00000E+00  2.00000E+00
+GW     4     1   0.00000E+00  0.00000E+00  8.20000E+00  0.00000E+00  0.00000E+00  8.70000E+00  5.00000E-02
+GE     1     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     2     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
-RP     0    19    37   1000  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
 FR     0    21     0      0  9.80000E-01  2.00000E-03  1.02000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+RP     0     4     4      0  0.00000E+00  0.00000E+00  5.00000E+00  5.00000E+00  0.00000E+00  0.00000E+00
+GN     1     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/1MHz_helivert.nec b/examples/1MHz_helivert.nec
index 4ca5256..437647b 100644
--- a/examples/1MHz_helivert.nec
+++ b/examples/1MHz_helivert.nec
@@ -1,13 +1,14 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  Top-loaded helical vertical for 1.0 MHz, over perfect ground.
 CM  The input impedance is such that a 16:1 quadrifilar toroid
 CM  transformer should raise it to 50 Ohms.
-CE End Comments
-GW     1     3  0.00000E+00  0.00000E+00  1.32000E+01  5.99500E+00  0.00000E+00  1.32000E+01  3.00000E-02
-GW     1     1  5.99500E+00  0.00000E+00  1.32000E+01  5.53800E+00  2.29100E+00  1.32000E+01  3.00000E-02
-GR     0    16  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
-GW     1     1  1.00000E+00  0.00000E+00  1.30000E+01  0.00000E+00  0.00000E+00  1.32000E+01  3.00000E-02
-GH     2    80  1.30000E+00  1.30000E+01  1.00000E+00  1.00000E+00  1.00000E+00  1.00000E+00  3.00000E-02
-GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+CE --- End Comments ---
+GW     1     3   0.00000E+00  0.00000E+00  1.32000E+01  5.99500E+00  0.00000E+00  1.32000E+01  3.00000E-02
+GW     1     1   5.99500E+00  0.00000E+00  1.32000E+01  5.53800E+00  2.29100E+00  1.32000E+01  3.00000E-02
+GR     0    16   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+GW     1     1   1.00000E+00  0.00000E+00  1.30000E+01  0.00000E+00  0.00000E+00  1.32000E+01  3.00000E-02
+GH     2    80   1.30000E+00  1.30000E+01  1.00000E+00  1.00000E+00  1.00000E+00  1.00000E+00  3.00000E-02
+GE     1     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 GN     1     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 FR     0    21     0      0  9.80000E-01  2.00000E-03  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     2     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/1MHz_tower.nec b/examples/1MHz_tower.nec
index 297dbf0..c78f194 100644
--- a/examples/1MHz_tower.nec
+++ b/examples/1MHz_tower.nec
@@ -1,7 +1,8 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Top-loaded tower for 1.0 MHz, over perfect ground.
 CM Each leg is loaded by an inductance to ground.
 CM Tower is fed at one of the loaded legs.
-CE End Comments
+CE --- End Comments ---
 GW     1     1  1.24900E+00  0.00000E+00  1.24900E+00  0.00000E+00  1.24900E+00  1.24900E+00  5.00000E-02
 GW     1     1  1.24900E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.24900E+00  1.24900E+00  5.00000E-02
 GM     0     8  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.24900E+00  0.00000E+00
diff --git a/examples/20-40m_ground_plane.nec b/examples/20-40m_ground_plane.nec
index abdbe7e..9488c96 100644
--- a/examples/20-40m_ground_plane.nec
+++ b/examples/20-40m_ground_plane.nec
@@ -1,6 +1,7 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Dual band base-loaded 7 & 14 MHz Ground Plane.
 CM Infinite perfect ground
-CE End Comments
+CE --- End Comments ---
 GW     1    20  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.30000E+01  2.50000E-02
 GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 GN     1     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/20-40m_vert_circ_cliff.nec b/examples/20-40m_vert_circ_cliff.nec
index fbb3923..7a258e6 100644
--- a/examples/20-40m_vert_circ_cliff.nec
+++ b/examples/20-40m_vert_circ_cliff.nec
@@ -1,6 +1,7 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Dual band base loaded 7 & 14 MHz Ground Plane.
 CM Finite ground with radials, circular cliff.
-CE End Comments
+CE --- End Comments ---
 GW     1    32  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.31000E+01  2.50000E-02
 GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     1     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/20-40m_vert_linear_cliff.nec b/examples/20-40m_vert_linear_cliff.nec
index d0c295e..260b58a 100644
--- a/examples/20-40m_vert_linear_cliff.nec
+++ b/examples/20-40m_vert_linear_cliff.nec
@@ -1,6 +1,7 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Dual band base-loaded 7 & 14 MHz Ground Plane.
 CM Finite ground with radials, linear cliff.
-CE End Comments
+CE --- End Comments ---
 GW     1    32  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.31000E+01  2.50000E-02
 GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     1     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/20-40m_vert_sommerfeld_cliff.nec b/examples/20-40m_vert_sommerfeld_cliff.nec
index 9f4dc1b..74d1687 100644
--- a/examples/20-40m_vert_sommerfeld_cliff.nec
+++ b/examples/20-40m_vert_sommerfeld_cliff.nec
@@ -1,6 +1,7 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Dual band base loaded 7 & 14 MHz Ground Plane.
 CM Finite ground, no radials, linear cliff, Sommerfeld method.
-CE End Comments
+CE --- End Comments ---
 GW     1    32  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.31000E+01  2.50000E-02
 GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     1     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/20m_car_ant.nec b/examples/20m_car_ant.nec
index 50de1b7..55430bc 100644
--- a/examples/20m_car_ant.nec
+++ b/examples/20m_car_ant.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  14 MHz vertical whip on a car roof
-CE End Comments
+CE --- End Comments ---
 GW     1     9  0.00000E+00  0.00000E+00  0.00000E+00  2.69000E+00  0.00000E+00  0.00000E+00  4.80000E-02
 GW     1     3  2.69000E+00  0.00000E+00  0.00000E+00  2.69000E+00  0.00000E+00  7.90000E-01  4.80000E-02
 GW     1     9  2.69000E+00  0.00000E+00  7.90000E-01  0.00000E+00  0.00000E+00  7.90000E-01  4.80000E-02
diff --git a/examples/20m_quad.nec b/examples/20m_quad.nec
index 3fe6de2..1d662c2 100644
--- a/examples/20m_quad.nec
+++ b/examples/20m_quad.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM 3 Element Quad for 14 MHz
 CM NOTE: This input file uses the modified GS command available
 CM in xnec2c, where scaling is specified for a range of tag numbers.
diff --git a/examples/23cm_helix+radials.nec b/examples/23cm_helix+radials.nec
index 03c0c4a..c8cdc75 100644
--- a/examples/23cm_helix+radials.nec
+++ b/examples/23cm_helix+radials.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  Helix and radial reflector for 1296 MHz
-CE End Comments
+CE --- End Comments ---
 GW     2    10  0.00000E+00  0.00000E+00  0.00000E+00  4.50000E-02  0.00000E+00  0.00000E+00  3.00000E-03
 GR     0     8  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 GM     0     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00 -3.00000E-02  0.00000E+00
diff --git a/examples/23cm_helix+screen.nec b/examples/23cm_helix+screen.nec
index b070195..7361d5e 100644
--- a/examples/23cm_helix+screen.nec
+++ b/examples/23cm_helix+screen.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  Helix and screen reflector for 1296 MHz
-CE End Comments
+CE --- End Comments ---
 GH     1   478  6.70000E-02  1.00000E+00  4.30000E-02  4.30000E-02  4.30000E-02  4.30000E-02  3.00000E-03
 GM     0     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  3.00000E-02  0.00000E+00
 GW     2     7  0.00000E+00  0.00000E+00  0.00000E+00  4.30000E-02  0.00000E+00  3.00000E-02  3.00000E-03
diff --git a/examples/2m_1:4l-gp_on_pole.nec b/examples/2m_1:4l-gp_on_pole.nec
index f4e1ffb..c7a155e 100644
--- a/examples/2m_1:4l-gp_on_pole.nec
+++ b/examples/2m_1:4l-gp_on_pole.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Ground Plane for 2m mounted on a 3m pole
 CM It just shows where your RF goes with such a setup ;-)
 CE --- End Comments ---
diff --git a/examples/2m_5:8l-gp_on_pole.nec b/examples/2m_5:8l-gp_on_pole.nec
index 0c48e5f..f7e9e29 100644
--- a/examples/2m_5:8l-gp_on_pole.nec
+++ b/examples/2m_5:8l-gp_on_pole.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM 5/8 lambda Ground Plane for 2m mounted on a 3m pole
 CM It just shows where your RF goes with such a setup ;-)
 CE --- End Comments ---
diff --git a/examples/2m_EME_ant.nec b/examples/2m_EME_ant.nec
index 4b1d8ca..6f7f321 100644
--- a/examples/2m_EME_ant.nec
+++ b/examples/2m_EME_ant.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c-2.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM EME antenna for 2m, with extended double Zeppelin driven element
 CM and reflector. Director is traditional Yagi sized in length.
 CM Feeding is done with a balanced line harness, not shown here.
diff --git a/examples/2m_bigwheel.nec b/examples/2m_bigwheel.nec
index c5034a2..94291ef 100644
--- a/examples/2m_bigwheel.nec
+++ b/examples/2m_bigwheel.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 0.9-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Big Wheel horizontally polarized omni antenna for 2m
 CE --- End Comments ---
 GA     1    21  6.65000E-01  0.00000E+00  7.00000E+01  3.00000E-03  2.06474E+00  0.00000E+00  0.00000E+00
diff --git a/examples/2m_extended_Xpol_yagi.nec b/examples/2m_extended_Xpol_yagi.nec
new file mode 100644
index 0000000..e0308da
--- /dev/null
+++ b/examples/2m_extended_Xpol_yagi.nec
@@ -0,0 +1,13 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
+CM X-polarized extended Yagi - RHCP
+CE --- End Comments ---
+GW     1    61   1.39500E+00  0.00000E+00  0.00000E+00 -1.39500E+00  0.00000E+00  0.00000E+00  7.50000E-03
+GW     2    67   1.52500E+00 -2.60000E-01  0.00000E+00 -1.52500E+00 -2.60000E-01  0.00000E+00  7.50000E-03
+GW     3    19   4.20000E-01  2.30000E-01  0.00000E+00 -4.20000E-01  2.30000E-01  0.00000E+00  7.50000E-03
+GM     3     1   0.00000E+00 -9.00000E+01  0.00000E+00  0.00000E+00  5.10000E-01  0.00000E+00  1.00000E+00
+GE     0     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+EX     0     1    31      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+EX     0     4    31     0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+FR     0    21     0      0  1.44000E+02  2.00000E-01  1.48000E+02  0.00000E+00  0.00000E+00  0.00000E+00
+RP     0    73    37      0  0.00000E+00  0.00000E+00  2.50000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/2m_extended_yagi.nec b/examples/2m_extended_yagi.nec
new file mode 100644
index 0000000..f1f69eb
--- /dev/null
+++ b/examples/2m_extended_yagi.nec
@@ -0,0 +1,11 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
+CM 2m Extended Yagi
+CE --- End Comments ---
+GW     1    61   1.39500E+00  0.00000E+00  0.00000E+00 -1.39500E+00  0.00000E+00  0.00000E+00  7.50000E-03
+GW     2    67   1.52500E+00 -2.60000E-01  0.00000E+00 -1.52500E+00 -2.60000E-01  0.00000E+00  7.50000E-03
+GW     3    19   4.20000E-01  2.30000E-01  0.00000E+00 -4.20000E-01  2.30000E-01  0.00000E+00  7.50000E-03
+GE     0     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+EX     0     1    31      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+FR     0    21     0      0  1.44000E+02  2.00000E-01  1.48000E+02  0.00000E+00  0.00000E+00  0.00000E+00
+RP     0    73    37      0  0.00000E+00  0.00000E+00  2.50000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/2m_halo_stack.nec b/examples/2m_halo_stack.nec
index 2c39cbe..7444cb4 100644
--- a/examples/2m_halo_stack.nec
+++ b/examples/2m_halo_stack.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c-2.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM A stack of two halo antennas for 2m. Note that the 
 CM circumference of the halos is .625l, not 0.5l
 CE --- End Comments ---
diff --git a/examples/2m_sqr_halo.nec b/examples/2m_sqr_halo.nec
index c926c27..3d97958 100644
--- a/examples/2m_sqr_halo.nec
+++ b/examples/2m_sqr_halo.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c-2.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM A square halo antenna for 2m. Circumference is 0.625l
 CE --- End Comments ---
 GW     1     7 -1.62000E-01  1.62000E-01  0.00000E+00  1.62000E-01  1.62000E-01  0.00000E+00  6.00000E-03
diff --git a/examples/2m_sqr_halo_stack.nec b/examples/2m_sqr_halo_stack.nec
index ce116b0..17d2ef7 100644
--- a/examples/2m_sqr_halo_stack.nec
+++ b/examples/2m_sqr_halo_stack.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c-2.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM A stack of two square halos for 2m. Circumference is 0.625l
 CE --- End Comments ---
 GW     1     7 -1.62000E-01  1.62000E-01  0.00000E+00  1.62000E-01  1.62000E-01  0.00000E+00  6.00000E-03
diff --git a/examples/2m_xpol_omni.nec b/examples/2m_xpol_omni.nec
index b5ab17a..e55e41c 100644
--- a/examples/2m_xpol_omni.nec
+++ b/examples/2m_xpol_omni.nec
@@ -1,3 +1,4 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Cross-polarized omni-directional antenna for 144 MHz
 CE --- End Comments ---
 GW     1    20  0.00000E+00  0.00000E+00  2.00000E-02  6.92700E-01  2.51900E-01  2.61800E-01  3.00000E-03
diff --git a/examples/2m_xpol_omni_stack.nec b/examples/2m_xpol_omni_stack.nec
index 5d34eed..21227f4 100644
--- a/examples/2m_xpol_omni_stack.nec
+++ b/examples/2m_xpol_omni_stack.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Vertically-stacked omni-directional RH-polarized anrtenna for 2m
-CE End Comments
+CE --- End Comments ---
 GW     1    20  0.00000E+00  0.00000E+00  2.00000E-02  6.92700E-01  2.51900E-01  2.61800E-01  3.00000E-03
 GW     2    20  0.00000E+00  0.00000E+00 -2.00000E-02  6.92700E-01 -2.51900E-01 -2.61800E-01  3.00000E-03
 GW     3    20  6.92700E-01  2.51900E-01  2.61800E-01  6.92700E-01 -2.51900E-01 -2.61800E-01  3.00000E-03
diff --git a/examples/2m_yagi.nec b/examples/2m_yagi.nec
index 6250952..61900ba 100644
--- a/examples/2m_yagi.nec
+++ b/examples/2m_yagi.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  Yagi for 145 MHz
-CE End Comments
+CE --- End Comments ---
 GW     1    25  0.00000E+00  5.09000E-01  0.00000E+00  0.00000E+00 -5.09000E-01  0.00000E+00  5.00000E-03
 GW     2    25  4.00000E-01  4.84000E-01  0.00000E+00  4.00000E-01 -4.84000E-01  0.00000E+00  5.00000E-03
 GW     3    22  7.00000E-01  4.59000E-01  0.00000E+00  7.00000E-01 -4.59000E-01  0.00000E+00  5.00000E-03
diff --git a/examples/30-80m_inv_L.nec b/examples/30-80m_inv_L.nec
index 31fc3cd..70f4ac5 100644
--- a/examples/30-80m_inv_L.nec
+++ b/examples/30-80m_inv_L.nec
@@ -1,10 +1,11 @@
-CM --- NEC2 Input File created by xnec2c 2.4 ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
+CM 30-80m Inverted L antenna
 CE --- End Comments ---
-GW     1    31  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.68000E+01  1.50000E-03
-GW     2    18  0.00000E+00  0.00000E+00  1.68000E+01  9.00000E+00  0.00000E+00  1.68000E+01  1.50000E-03
-GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
+GW     1    31   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  1.68000E+01  1.50000E-03
+GW     2    18   0.00000E+00  0.00000E+00  1.68000E+01  9.00000E+00  0.00000E+00  1.68000E+01  1.50000E-03
+GE     1     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 EX     0     1     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 FR     0    46     0      0  3.00000E+00  2.00000E-01  1.20000E+01  0.00000E+00  0.00000E+00  0.00000E+00
 GN     1     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
-RP     0    19    37      0  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+RP     0    19    37  1000  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
 EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/35-55MHz_logper.nec b/examples/35-55MHz_logper.nec
index fc3214d..99d8759 100644
--- a/examples/35-55MHz_logper.nec
+++ b/examples/35-55MHz_logper.nec
@@ -1,8 +1,9 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  12 ELEMENT LOG PERIODIC ANTENNA IN FREE SPACE.
 CM  78 SEGMENTS. SIGMA=D/L RECEIVING AND TRANS. PATTERNS.
 CM  DIPOLE LENGTH TO DIAMETER RATIO=150.
 CM  TAU=0.93, SIGMA=0.70, BOOM IMPEDANCE=50. OHMS.
-CE End Comments
+CE --- End Comments ---
 GW     1     9  0.00000E+00 -1.00000E+00  0.00000E+00  0.00000E+00  1.00000E+00  0.00000E+00  7.00000E-03
 GW     2     9 -7.53000E-01 -1.07500E+00  0.00000E+00 -7.53000E-01  1.07500E+00  0.00000E+00  7.00000E-03
 GW     3     9 -1.56200E+00 -1.15600E+00  0.00000E+00 -1.56200E+00  1.15600E+00  0.00000E+00  8.00000E-03
diff --git a/examples/40m-moxon.nec b/examples/40m-moxon.nec
index f869152..5859236 100644
--- a/examples/40m-moxon.nec
+++ b/examples/40m-moxon.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c-1.2 ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Moxon antenna for 40m
 CE --- End Comments ---
 GW     1    19  2.56000E+00  0.00000E+00  2.00000E+00  2.56000E+00  0.00000E+00  1.74000E+01  1.50000E-03
diff --git a/examples/6-17m_bipyramid.nec b/examples/6-17m_bipyramid.nec
index c90d9d0..56206c8 100644
--- a/examples/6-17m_bipyramid.nec
+++ b/examples/6-17m_bipyramid.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Skeleton bi-pyramid antenna for 14-52 MHz
 CE --- End Comments ---
 GW     1    18  1.34400E+00  0.00000E+00  1.62400E+00  0.00000E+00  0.00000E+00  1.12000E-01  3.00000E-03
diff --git a/examples/6-20m_inv_cone.nec b/examples/6-20m_inv_cone.nec
index d2d9414..e18668c 100644
--- a/examples/6-20m_inv_cone.nec
+++ b/examples/6-20m_inv_cone.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Skeleton bi-pyramid antenna for 14-52 MHz
 CE --- End Comments ---
 GW     1    25  0.00000E+00  0.00000E+00  1.12000E-01  1.06000E+00  0.00000E+00  3.00000E+00  3.00000E-03
diff --git a/examples/6m_big-square_stack.nec b/examples/6m_big-square_stack.nec
index f26696f..43c3344 100644
--- a/examples/6m_big-square_stack.nec
+++ b/examples/6m_big-square_stack.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 0.9-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Big Square horizontally polarized omni antenna for 2m
 CE --- End Comments ---
 GW     1    16  0.00000E+00  0.00000E+00  5.00000E-02  1.75800E+00  0.00000E+00  0.00000E+00  6.00000E-03
diff --git a/examples/6m_bigwheel-stack.nec b/examples/6m_bigwheel-stack.nec
index 44ad45e..bd8fc01 100644
--- a/examples/6m_bigwheel-stack.nec
+++ b/examples/6m_bigwheel-stack.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 0.9-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Big Wheel horizontally polarized omni antenna for 2m
 CE --- End Comments ---
 GA     1    21  1.85000E+00  0.00000E+00  7.00000E+01  6.00000E-03  1.97451E+00  0.00000E+00  0.00000E+00
diff --git a/examples/70cm_collinear.nec b/examples/70cm_collinear.nec
index cfd6f0b..a32ec0c 100644
--- a/examples/70cm_collinear.nec
+++ b/examples/70cm_collinear.nec
@@ -1,6 +1,7 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  432 MHz stacked Extended Double Zeppelin with two
 CM  reflectors and directors mounted on driven elements
-CE End Comments
+CE --- End Comments ---
 GW     1    21  0.00000E+00 -2.31000E-01  3.42000E-01  0.00000E+00  2.31000E-01  3.42000E-01  7.50000E-03
 GW     2     7  0.00000E+00 -3.85000E-01  3.42000E-01  0.00000E+00 -2.31000E-01  3.42000E-01  7.50000E-03
 GW     3     7  0.00000E+00  3.85000E-01  3.42000E-01  0.00000E+00  2.31000E-01  3.42000E-01  7.50000E-03
diff --git a/examples/80m_zepp.nec b/examples/80m_zepp.nec
index a48588a..bebafa4 100644
--- a/examples/80m_zepp.nec
+++ b/examples/80m_zepp.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.1-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Balloon Vertical for 80m. 1/2 wave fed with 1/4 wave feeder.
 CE --- End Comments ---
 GW     1    27  0.00000E+00  0.00000E+00  2.00000E+01  0.00000E+00  0.00000E+00  6.05000E+01  1.50000E-03
diff --git a/examples/T12m-H24m.nec b/examples/T12m-H24m.nec
index 10e5195..45f5781 100644
--- a/examples/T12m-H24m.nec
+++ b/examples/T12m-H24m.nec
@@ -1,4 +1,5 @@
-CM --- NEC2 Input File created by xnec2c 2.4 ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
+CM T Antenna for Medium Wave band
 CE --- End Comments ---
 GW     2     1  0.00000E+00  6.00000E+00  2.40000E+01  1.50000E+00  6.00000E+00  2.40000E+01  2.50000E-03
 GX     0   100  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/T20m-H18m.nec b/examples/T20m-H18m.nec
index 1f78cec..6eb40a8 100644
--- a/examples/T20m-H18m.nec
+++ b/examples/T20m-H18m.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 2.4 ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM T antenna for the high end of the MW band
 CE --- End Comments ---
 GW     2     1  0.00000E+00  1.00000E+01  1.80000E+01  1.50000E+00  1.00000E+01  1.80000E+01  2.50000E-03
diff --git a/examples/airplane.nec b/examples/airplane.nec
index 5d5800e..68f2aaa 100644
--- a/examples/airplane.nec
+++ b/examples/airplane.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Jet plane with trailing wire antenna
-CE End Comments
+CE --- End Comments ---
 GW     1     1  7.69703E+00 -3.05237E-01  1.51819E+00  7.69703E+00  7.00000E-06  1.51819E+00  1.00000E-02
 GW     2     1  1.28670E+01  1.66028E-01  2.99715E+00  1.28695E+01  0.00000E+00  2.99701E+00  1.00000E-02
 GW     3     1  1.69070E+01  0.00000E+00  2.77578E+00  1.28670E+01  1.66030E-01  2.99715E+00  1.00000E-02
diff --git a/examples/buoy.nec b/examples/buoy.nec
index fbae9e6..6f21b23 100644
--- a/examples/buoy.nec
+++ b/examples/buoy.nec
@@ -1,6 +1,7 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM Short vertical antenna over sea as ground (buoy)
 CM Base loaded for resonance around 13.75 MHz
-CE End Comments
+CE --- End Comments ---
 GW     1     6  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  2.20000E+00  2.00000E-02
 GE     1     0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 FR     0    11     0      0  1.00000E+01  5.00000E-01  1.50000E+01  0.00000E+00  0.00000E+00  0.00000E+00
@@ -9,5 +10,5 @@ LD     0     1     1      1  0.00000E+00  3.85000E-06  0.00000E+00  0.00000E+00
 GN     2     0     0      0  8.00000E+01  4.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
 NE     0    16     1      8 -7.50000E+00  0.00000E+00  5.00000E-01  1.00000E+00  1.00000E+00  1.00000E+00
 NH     0    16     1      8 -7.50000E+00  0.00000E+00  5.00000E-01  1.00000E+00  1.00000E+00  1.00000E+00
-RP     0    19    37   1000  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
+RP     0    19    37  1000  0.00000E+00  0.00000E+00  5.00000E+00  1.00000E+01  0.00000E+00  0.00000E+00
 EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
diff --git a/examples/conductivity.txt b/examples/conductivity.txt
index 41a7053..24dc476 100644
--- a/examples/conductivity.txt
+++ b/examples/conductivity.txt
@@ -1,12 +1,12 @@
  |------------------------------------------------|
  | Material			| Ohm.m @ 20 �C | S/m @ 20 �C |
  |------------------------------------------------|
- | Silver			| 1.59�10-8		| 6.30�107    |
- | Copper			| 1.68�10-8		| 5.96�107    |
- | Gold				| 2.44�10-8		| 4.10�107    |
- | Aluminium		| 2.82�10-8		| 3.5�107     |
- | Iron				| 1.0�10-7		| 1.00�107    |
- | Titanium			| 4.20�10-7		| 2.38�106    |
- | Stainless Steel	| 6.9�10-7		| 1.45�106    |
- | Sea water		| 2�10-1		| 4.8         |
+ | Silver			| 1.59�10^-8	| 6.30�10^7   |
+ | Copper			| 1.68�10^-8	| 5.96�10^7   |
+ | Gold				| 2.44�10^-8	| 4.10�10^7   |
+ | Aluminium		| 2.82�10^-8	| 3.5�10^7    |
+ | Iron				| 1.00�10^-7	| 1.00�10^7   |
+ | Titanium			| 4.20�10^-7	| 2.38�10^6   |
+ | Stainless Steel	| 6.9�10^-7		| 1.45�10^6   |
+ | Sea water		| 2�10^-1		| 4.8         |
  |------------------------------------------------|
diff --git a/examples/gray_hoverman.nec b/examples/gray_hoverman.nec
index d64f049..3cf0372 100644
--- a/examples/gray_hoverman.nec
+++ b/examples/gray_hoverman.nec
@@ -1,4 +1,5 @@
-CM --- Gray-Hoverman - Patch Reflector ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
+CM Gray-Hoverman - Patch Reflector
 CE --- End Comments ---
 GW     1    15  2.76500E-01  0.00000E+00  4.03500E-01  1.34500E-01  0.00000E+00  4.03500E-01  2.50000E-03
 GW     2    20  1.34500E-01  0.00000E+00  4.03500E-01  0.00000E+00  0.00000E+00  2.69000E-01  2.50000E-03
diff --git a/examples/k9ay_5b4az.nec b/examples/k9ay_5b4az.nec
index 90a8c64..367e27a 100644
--- a/examples/k9ay_5b4az.nec
+++ b/examples/k9ay_5b4az.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM K9AY directional small receiving loop 1.8-4.0 MHz.
 CM By connecting two adjacent feed points in parallel,
 CM the radiation pattern can be rotated 45 degrees so
diff --git a/examples/k9ay_orig.nec b/examples/k9ay_orig.nec
index 7e23844..5a43e39 100644
--- a/examples/k9ay_orig.nec
+++ b/examples/k9ay_orig.nec
@@ -1,4 +1,4 @@
-CM --- NEC2 Input File created by xnec2c 1.0-beta ---
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM K9AY directional small receiving loop 1.8-4.0 MHz
 CE --- End Comments ---
 GW     1     8  0.00000E+00  0.00000E+00  8.50000E+00  5.00000E+00  0.00000E+00  1.50000E+00  1.50000E-03
diff --git a/examples/satellite.nec b/examples/satellite.nec
index d4af9ae..d9afde6 100644
--- a/examples/satellite.nec
+++ b/examples/satellite.nec
@@ -1,5 +1,6 @@
+CM --- NEC2 Input File created or edited by xnec2c 3.2 ---
 CM  CYLINDER WITH ATTACHED WIRES
-CE End Comments
+CE --- End Comments ---
 SP     0     0  1.00000E-01  0.00000E+00  7.33300E-02  0.00000E+00  0.00000E+00  3.84000E-03  0.00000E+00
 SP     0     0  1.00000E-01  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  3.84000E-03  0.00000E+00
 SP     0     0  1.00000E-01  0.00000E+00 -7.33300E-02  0.00000E+00  0.00000E+00  3.84000E-03  0.00000E+00
diff --git a/install-sh b/install-sh
index 377bb86..0b0fdcb 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2013-12-25.23; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
 # This script is compatible with the BSD install script, but was written
 # from scratch.
 
+tab='	'
 nl='
 '
-IFS=" ""	$nl"
+IFS=" $tab$nl"
 
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
 
-# Don't use :- since 4.3BSD and earlier shells don't like it.
 doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
 
 # Put in absolute file names if you don't have them in your path;
 # or use environment vars.
@@ -68,17 +64,6 @@ mvprog=${MVPROG-mv}
 rmprog=${RMPROG-rm}
 stripprog=${STRIPPROG-strip}
 
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
 posix_mkdir=
 
 # Desired mode of installed file.
@@ -97,7 +82,7 @@ dir_arg=
 dst_arg=
 
 copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
 
 usage="\
 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -137,46 +122,57 @@ while test $# -ne 0; do
     -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-	shift;;
+        shift;;
 
     --help) echo "$usage"; exit $?;;
 
     -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
 
     -o) chowncmd="$chownprog $2"
-	shift;;
+        shift;;
 
     -s) stripcmd=$stripprog;;
 
-    -t) dst_arg=$2
-	# Protect names problematic for 'test' and other utilities.
-	case $dst_arg in
-	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
-	esac
-	shift;;
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
 
-    -T) no_target_directory=true;;
+    -T) is_target_a_directory=never;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    --)	shift
-	break;;
+    --) shift
+        break;;
 
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
 
     *)  break;;
   esac
   shift
 done
 
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   # When -d is used, all remaining arguments are directories to create.
   # When -t is used, the destination is already specified.
@@ -208,6 +204,15 @@ if test $# -eq 0; then
 fi
 
 if test -z "$dir_arg"; then
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
   do_exit='(exit $ret); exit $ret'
   trap "ret=129; $do_exit" 1
   trap "ret=130; $do_exit" 2
@@ -223,16 +228,16 @@ if test -z "$dir_arg"; then
 
     *[0-7])
       if test -z "$stripcmd"; then
-	u_plus_rw=
+        u_plus_rw=
       else
-	u_plus_rw='% 200'
+        u_plus_rw='% 200'
       fi
       cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
     *)
       if test -z "$stripcmd"; then
-	u_plus_rw=
+        u_plus_rw=
       else
-	u_plus_rw=,u+rw
+        u_plus_rw=,u+rw
       fi
       cp_umask=$mode$u_plus_rw;;
   esac
@@ -269,41 +274,15 @@ do
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
-	exit 1
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
       fi
       dstdir=$dst
       dst=$dstdir/`basename "$src"`
       dstdir_status=0
     else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
+      dstdir=`dirname "$dst"`
       test -d "$dstdir"
       dstdir_status=$?
     fi
@@ -314,74 +293,74 @@ do
   if test $dstdir_status != 0; then
     case $posix_mkdir in
       '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            if (umask $mkdir_umask &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/d" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
     esac
 
     if
       $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
       )
     then :
     else
@@ -391,53 +370,51 @@ do
       # directory the slow way, step by step, checking for races as we go.
 
       case $dstdir in
-	/*) prefix='/';;
-	[-=\(\)!]*) prefix='./';;
-	*)  prefix='';;
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
       esac
 
-      eval "$initialize_posix_glob"
-
       oIFS=$IFS
       IFS=/
-      $posix_glob set -f
+      set -f
       set fnord $dstdir
       shift
-      $posix_glob set +f
+      set +f
       IFS=$oIFS
 
       prefixes=
 
       for d
       do
-	test X"$d" = X && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
       done
 
       if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
       fi
     fi
   fi
@@ -472,15 +449,12 @@ do
 
     # If -C, don't bother to copy if it wouldn't change the file.
     if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
        set X $old && old=:$2:$4:$5:$6 &&
        set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
+       set +f &&
        test "$old" = "$new" &&
        $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
     then
@@ -493,24 +467,24 @@ do
       # to itself, or perhaps because mv is so ancient that it does not
       # support -f.
       {
-	# Now remove or move aside any old file at destination location.
-	# We try this two ways since rm can't unlink itself on some
-	# systems and the destination file might be busy for other
-	# reasons.  In this case, the final cleanup might fail but the new
-	# file should still install successfully.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
       }
     fi || exit 1
 
diff --git a/missing b/missing
index db98974..f62bbae 100755
--- a/missing
+++ b/missing
@@ -3,7 +3,7 @@
 
 scriptversion=2013-10-28.13; # UTC
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index 06a8cfe..fcd2c3b 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -33,8 +33,7 @@ exec_prefix = @exec_prefix@
 datadir = @datadir@
 datarootdir = @datarootdir@
 libdir = @libdir@
-DATADIRNAME = @DATADIRNAME@
-itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+localedir = @localedir@
 subdir = po
 install_sh = @install_sh@
 # Automake >= 1.8 provides @mkdir_p at .
@@ -80,7 +79,7 @@ INTLTOOL__v_MSGFMT_0 = @echo "  MSGFMT" $@;
 
 .po.pox:
 	$(MAKE) $(GETTEXT_PACKAGE).pot
-	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
+	$(MSGMERGE) $* $(GETTEXT_PACKAGE).pot -o $*.pox
 
 .po.mo:
 	$(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $<
@@ -108,7 +107,7 @@ install-data-no: all
 install-data-yes: all
 	linguas="$(USE_LINGUAS)"; \
 	for lang in $$linguas; do \
-	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
 	  $(mkdir_p) $$dir; \
 	  if test -r $$lang.gmo; then \
 	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
@@ -142,8 +141,8 @@ install-exec installcheck:
 uninstall:
 	linguas="$(USE_LINGUAS)"; \
 	for lang in $$linguas; do \
-	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
-	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
 	done
 
 check: all $(GETTEXT_PACKAGE).pot
diff --git a/src/Makefile.am b/src/Makefile.am
index 806c3cf..eebd76b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,7 @@
 ## Process this file with automake to produce Makefile.in
+AM_LDFLAGS = -Wl,--as-needed,-z,relro,-z,now
+AM_CFLAGS = --pedantic -Wall -std=gnu99 -O2 -D_FORTIFY_SOURCE=2 \
+		 -fstack-protector -Wformat -Werror=format-security -fpie
 
 AM_CPPFLAGS = \
 	-DPROGRAMNAME_LOCALEDIR=\""$(PROGRAMNAME_LOCALEDIR)"\" \
diff --git a/src/Makefile.in b/src/Makefile.in
index 07d5250..ae03f97 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -78,12 +88,11 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = xnec2c$(EXEEXT)
 subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -157,6 +166,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALL_LINGUAS = @ALL_LINGUAS@
@@ -285,6 +295,10 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+AM_LDFLAGS = -Wl,--as-needed,-z,relro,-z,now
+AM_CFLAGS = --pedantic -Wall -std=gnu99 -O2 -D_FORTIFY_SOURCE=2 \
+		 -fstack-protector -Wformat -Werror=format-security -fpie
+
 AM_CPPFLAGS = \
 	-DPROGRAMNAME_LOCALEDIR=\""$(PROGRAMNAME_LOCALEDIR)"\" \
 	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
@@ -337,7 +351,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu src/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -653,6 +666,8 @@ uninstall-am: uninstall-binPROGRAMS
 	ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-binPROGRAMS
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/calculations.c b/src/calculations.c
index c61780a..6824327 100644
--- a/src/calculations.c
+++ b/src/calculations.c
@@ -380,8 +380,8 @@ void intrp( double x, double y, complex double *f1,
   {
 	first_call = FALSE;
 	size_t mreq = 3*sizeof(int);
-	mem_alloc( (void *)&nda,  mreq, "in calculations.c");
-	mem_alloc( (void *)&ndpa, mreq, "in calculations.c");
+	mem_alloc( (void **)&nda,  mreq, "in calculations.c");
+	mem_alloc( (void **)&ndpa, mreq, "in calculations.c");
 	nda[0] = 11; nda[1] = 17; nda[2] = 9;
 	ndpa[0] = 110; ndpa[1] = 85; ndpa[2] = 72;
   }
@@ -1226,11 +1226,11 @@ trio( int j )
 	  {
 		segj.maxcon = segj.jsno +1;
 		size_t mreq = (size_t)segj.maxcon * sizeof(int);
-		mem_realloc( (void *)&segj.jco, mreq, "in calculations.c" );
+		mem_realloc( (void **)&segj.jco, mreq, "in calculations.c" );
 		mreq = (size_t)segj.maxcon * sizeof(double);
-		mem_realloc( (void *) &segj.ax, mreq, "in calculations.c" );
-		mem_realloc( (void *) &segj.bx, mreq, "in calculations.c" );
-		mem_realloc( (void *) &segj.cx, mreq, "in calculations.c" );
+		mem_realloc( (void **) &segj.ax, mreq, "in calculations.c" );
+		mem_realloc( (void **) &segj.bx, mreq, "in calculations.c" );
+		mem_realloc( (void **) &segj.cx, mreq, "in calculations.c" );
 	  }
 
 	  sbf( j, j, &segj.ax[jsnox], &segj.bx[jsnox], &segj.cx[jsnox]);
@@ -1258,11 +1258,11 @@ trio( int j )
 	  {
 		segj.maxcon = segj.jsno +1;
 		size_t mreq = (size_t)segj.maxcon * sizeof(int);
-		mem_realloc( (void *)&segj.jco, mreq, "in calculations.c" );
+		mem_realloc( (void **)&segj.jco, mreq, "in calculations.c" );
 		mreq = (size_t)segj.maxcon * sizeof(double);
-		mem_realloc( (void *) &segj.ax, mreq, "in calculations.c" );
-		mem_realloc( (void *) &segj.bx, mreq, "in calculations.c" );
-		mem_realloc( (void *) &segj.cx, mreq, "in calculations.c" );
+		mem_realloc( (void **) &segj.ax, mreq, "in calculations.c" );
+		mem_realloc( (void **) &segj.bx, mreq, "in calculations.c" );
+		mem_realloc( (void **) &segj.cx, mreq, "in calculations.c" );
 	  }
 
 	  sbf( jcox, j, &segj.ax[jsnox], &segj.bx[jsnox], &segj.cx[jsnox]);
@@ -1305,11 +1305,11 @@ trio( int j )
   {
 	segj.maxcon = segj.jsno +1;
 	size_t mreq = (size_t)segj.maxcon * sizeof(int);
-	mem_realloc( (void *)&segj.jco, mreq, "in calculations.c" );
+	mem_realloc( (void **)&segj.jco, mreq, "in calculations.c" );
 	mreq = (size_t)segj.maxcon * sizeof(double);
-	mem_realloc( (void *) &segj.ax, mreq, "in calculations.c" );
-	mem_realloc( (void *) &segj.bx, mreq, "in calculations.c" );
-	mem_realloc( (void *) &segj.cx, mreq, "in calculations.c" );
+	mem_realloc( (void **) &segj.ax, mreq, "in calculations.c" );
+	mem_realloc( (void **) &segj.bx, mreq, "in calculations.c" );
+	mem_realloc( (void **) &segj.cx, mreq, "in calculations.c" );
   }
 
   sbf( j, j, &segj.ax[jsnox], &segj.bx[jsnox], &segj.cx[jsnox]);
diff --git a/src/callback_func.c b/src/callback_func.c
index ca260e6..0619f94 100644
--- a/src/callback_func.c
+++ b/src/callback_func.c
@@ -66,13 +66,34 @@ New_Viewer_Angle(
   /* Recalculate projection paramenters */
   params->Wr = wr;
   params->Wi = wi;
-  gtk_spin_button_set_value( wr_spb, (gdouble)params->Wr );
-  gtk_spin_button_set_value( wi_spb, (gdouble)params->Wi );
+
+  /* Set new value */
+  Set_Spin_Button( wr_spb, (gdouble)params->Wr );
+  Set_Spin_Button( wi_spb, (gdouble)params->Wi );
 
 } /* New_Viewer_Angle() */
 
 /*-----------------------------------------------------------------------*/
 
+/* Set_Spin_Button()
+ *
+ * Sets the value of a spin button
+ */
+  void
+Set_Spin_Button( GtkSpinButton *spin, gdouble value )
+{
+  /* Save original value and set new */
+  gdouble sav = gtk_spin_button_get_value( spin );
+  gtk_spin_button_set_value( spin, value );
+
+  /* Issue a value_changed signal if needed (given same values) */
+  if( sav == value )
+	g_signal_emit_by_name( G_OBJECT(spin), "value_changed", NULL );
+
+} /* Set_Spin_Button() */
+
+/*-----------------------------------------------------------------------*/
+
 /* Create_Pixmap()
  *
  * Creates or resizes a pixmap after a configure event
@@ -114,14 +135,17 @@ Create_Pixmap(
  */
 void
 Motion_Event(
-	GdkEventMotion  *event, projection_parameters_t *params,
-	GtkSpinButton *wr_spb, GtkSpinButton *wi_spb )
+	GdkEventMotion *event,
+	projection_parameters_t *params )
 {
   /* Save previous pointer position */
-  static gdouble x_old = 0, y_old = 0;
+  static gdouble x_old = 0.0, y_old = 0.0;
 
   gdouble x = event->x;
   gdouble y = event->y;
+  gdouble dx, dy;
+  gchar value[6];
+  size_t s = sizeof( value );
 
   /* Initialize saved x,y */
   if( params->reset )
@@ -131,29 +155,68 @@ Motion_Event(
 	params->reset = FALSE;
   }
 
-  /* Recalculate projection parameters according to pointer motion.
-   * Setting rotate and incline values to spinbuttons triggers redraw */
+  /* Recalculate projection parameters
+   * according to pointer motion */
+  dx = x - x_old;
+  dy = y - y_old;
+  x_old = x;
+  y_old = y;
+
+  /* Other buttons are used for moving axes on screen */
   if( event->state & GDK_BUTTON1_MASK )
   {
-	params->Wr -= (x - x_old) / 4.0;
-	params->Wi += (y - y_old) / 4.0;
-	gtk_spin_button_set_value( wr_spb, params->Wr );
-	gtk_spin_button_set_value( wi_spb, params->Wi );
-  } /* if( event->state & GDK_BUTTON1_MASK ) */
+	/* Set the structure rotate/incline spinbuttons */
+	if( isFlagSet(COMMON_PROJECTION) ||
+		(params->type == STRUCTURE_DRAWINGAREA) )
+	{
+	  structure_proj_params.Wr -= dx / (gdouble)MOTION_EVENTS_COUNT;
+	  structure_proj_params.Wi += dy / (gdouble)MOTION_EVENTS_COUNT;
+	  snprintf( value, s, "%d", (int)structure_proj_params.Wr );
+	  gtk_entry_set_text( GTK_ENTRY(rotate_structure), value );
+	  snprintf( value, s, "%d", (int)structure_proj_params.Wi );
+	  gtk_entry_set_text( GTK_ENTRY(incline_structure), value );
+	}
+
+	/* Set the rdpattern rotate/incline spinbuttons */
+	if( (isFlagSet(DRAW_ENABLED) &&
+		  isFlagSet(COMMON_PROJECTION)) ||
+		(params->type == RDPATTERN_DRAWINGAREA) )
+	{
+	  rdpattern_proj_params.Wr -= dx / (gdouble)MOTION_EVENTS_COUNT;
+	  rdpattern_proj_params.Wi += dy / (gdouble)MOTION_EVENTS_COUNT;
+	  snprintf( value, s, "%d", (int)rdpattern_proj_params.Wr );
+	  gtk_entry_set_text( GTK_ENTRY(rotate_rdpattern), value );
+	  snprintf( value, s, "%d", (int)rdpattern_proj_params.Wi );
+	  gtk_entry_set_text( GTK_ENTRY(incline_rdpattern), value );
+	}
+
+	/* Rotate/incline structure */
+	if( params->type == STRUCTURE_DRAWINGAREA )
+	{
+	  New_Structure_Projection_Angle();
+	  if( isFlagSet(DRAW_ENABLED) &&
+		  isFlagSet(COMMON_PROJECTION) )
+		New_Radiation_Projection_Angle();
+	}
+	else if( params->type == RDPATTERN_DRAWINGAREA )
+	{
+	  /* Rotate/incline rdpattern */
+	  New_Radiation_Projection_Angle();
+	  if( isFlagSet(COMMON_PROJECTION) )
+		New_Structure_Projection_Angle();
+	}
+  }    /* if( event->state & GDK_BUTTON1_MASK ) */
   else
   {
-	params->x_center += x - x_old;
-	params->y_center -= y - y_old;
-
+	/* Move structure or rdpattern axes on screen */
+	params->x_center += dx;
+	params->y_center -= dy;
 	if( params->type == STRUCTURE_DRAWINGAREA )
 	  Draw_Structure( structure_drawingarea );
 	if( params->type == RDPATTERN_DRAWINGAREA )
 	  Draw_Radiation( rdpattern_drawingarea );
   }
 
-  x_old = x;
-  y_old = y;
-
 } /* Motion_Event() */
 
 /*-----------------------------------------------------------------------*/
@@ -188,8 +251,8 @@ Plot_Select( GtkToggleButton *togglebutton, unsigned long long int flag )
  *
  * Handles user request to delete a window
  */
-  void
-Delete_Event( gchar *message )
+ void
+Delete_Event( gchar *mesg )
 {
   quit_dialog = create_quit_dialog();
   gtk_widget_show( quit_dialog );
@@ -207,7 +270,7 @@ Delete_Event( gchar *message )
 		  "Really close this window?") );
   }
   else gtk_label_set_text( GTK_LABEL(lookup_widget(
-		  quit_dialog, "quit_label")), message );
+		  quit_dialog, "quit_label")), mesg );
 
 } /* Delete_Event() */
 
@@ -275,7 +338,6 @@ Open_Editor( GtkTreeView *view )
   GtkTreeIter iter;
   GtkTreeModel *model;
   gchar *card;
-  size_t s = sizeof( card );
   GtkWidget *button;
 
   /* Find the selected treeview row */
@@ -285,6 +347,7 @@ Open_Editor( GtkTreeView *view )
 
   /* Get the "card" name from first column */
   gtk_tree_model_get( model, &iter, 0, &card, -1);
+  size_t s = strlen( card );
 
   /* Some "cards" have common editors */
   if( strcmp(card, "GC") == 0 )
@@ -324,23 +387,19 @@ Open_Editor( GtkTreeView *view )
   void
 Main_Rdpattern_Activate( gboolean from_menu )
 {
-  /* Show current frequency. The small amount added
-   * allows the value of the spinbutton to change
-   * when the freq loop re-writes the frequency */
-  gtk_spin_button_set_value( rdpattern_frequency,
-	  (gdouble)(calc_data.fmhz + 0.0000001) );
-
   /* Set E field check menu item */
   if( fpat.nfeh & NEAR_EFIELD )
   {
 	gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(
-		  lookup_widget(rdpattern_window, "rdpattern_e_field")), TRUE );
+		  lookup_widget(rdpattern_window,
+			"rdpattern_e_field")), TRUE );
 	SetFlag( DRAW_EFIELD );
   }
   else
   {
 	gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(
-		  lookup_widget(rdpattern_window, "rdpattern_e_field")), FALSE );
+		  lookup_widget(rdpattern_window,
+			"rdpattern_e_field")), FALSE );
 	ClearFlag( DRAW_EFIELD );
   }
 
@@ -348,13 +407,15 @@ Main_Rdpattern_Activate( gboolean from_menu )
   if( fpat.nfeh & NEAR_HFIELD )
   {
 	gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(
-		  lookup_widget(rdpattern_window, "rdpattern_h_field")), TRUE );
+		  lookup_widget(rdpattern_window,
+			"rdpattern_h_field")), TRUE );
 	SetFlag( DRAW_HFIELD );
   }
   else
   {
 	gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(
-		  lookup_widget(rdpattern_window, "rdpattern_h_field")), FALSE );
+		  lookup_widget(rdpattern_window,
+			"rdpattern_h_field")), FALSE );
 	ClearFlag( DRAW_HFIELD );
   }
 
@@ -362,44 +423,67 @@ Main_Rdpattern_Activate( gboolean from_menu )
   if( (fpat.nfeh & NEAR_EHFIELD) == NEAR_EHFIELD )
   {
 	gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(
-		  lookup_widget(rdpattern_window, "rdpattern_poynting_vector")), TRUE );
+		  lookup_widget(rdpattern_window,
+			"rdpattern_poynting_vector")), TRUE );
 	SetFlag( DRAW_POYNTING );
   }
   else
   {
 	gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(
-		  lookup_widget(rdpattern_window, "rdpattern_poynting_vector")), FALSE );
+		  lookup_widget(rdpattern_window,
+			"rdpattern_poynting_vector")), FALSE );
 	ClearFlag( DRAW_POYNTING );
   }
 
   /* Set structure overlay in Rad Pattern window */
   if( isFlagClear(OVERLAY_STRUCT) )
 	gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(
-		  lookup_widget(rdpattern_window, "rdpattern_overlay_structure")), FALSE );
+		  lookup_widget(rdpattern_window,
+			"rdpattern_overlay_structure")), FALSE );
   else
 	gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(
-		  lookup_widget(rdpattern_window, "rdpattern_overlay_structure")), TRUE );
+		  lookup_widget(rdpattern_window,
+			"rdpattern_overlay_structure")), TRUE );
 
 
   /* Sync common projection spinbuttons */
   if( isFlagSet(COMMON_PROJECTION) )
   {
-	gtk_spin_button_set_value(
-		rotate_rdpattern, (gdouble)structure_proj_params.Wr );
-	gtk_spin_button_set_value(
-		incline_rdpattern, (gdouble)structure_proj_params.Wi );
+	gchar value[6];
+	size_t s = sizeof( value ) - 1;
+
+	rdpattern_proj_params.Wr = structure_proj_params.Wr;
+	rdpattern_proj_params.Wi = structure_proj_params.Wi;
+	snprintf( value, s, "%d", (int)rdpattern_proj_params.Wr );
+	value[s] = '\0';
+	gtk_entry_set_text( GTK_ENTRY(rotate_rdpattern), value );
+	snprintf( value, s, "%d", (int)rdpattern_proj_params.Wi );
+	value[s] = '\0';
+	gtk_entry_set_text( GTK_ENTRY(incline_rdpattern), value );
+  }
+  else	/* Initialize radiation pattern projection angles */
+  {
+	rdpattern_proj_params.Wr =
+	  gtk_spin_button_get_value(rotate_rdpattern);
+	rdpattern_proj_params.Wi =
+	  gtk_spin_button_get_value(incline_rdpattern);
   }
+  New_Radiation_Projection_Angle();
 
   /* Redo currents if not reaching this function
    * from the menu callback (e.g. not user action) */
   if( !crnt.valid && !from_menu ) Redo_Currents( NULL );
 
-  /* Initialize radiation pattern projection angles */
-  rdpattern_proj_params.Wr =
-	gtk_spin_button_get_value(rotate_rdpattern);
-  rdpattern_proj_params.Wi =
-	gtk_spin_button_get_value(incline_rdpattern);
-  New_Radiation_Projection_Angle();
+  /* Display frequency in freq spinbutton */
+  if( from_menu )
+  {
+	char value[9];
+	size_t s = sizeof( value );
+	snprintf( value, s, "%.3f", calc_data.fmhz );
+	value[s - 1] = '\0';
+	gtk_entry_set_text(
+		GTK_ENTRY(rdpattern_frequency), value );
+  }
 
   /* Enable Gain or E/H field drawing */
   SetFlag( DRAW_ENABLED );
@@ -426,7 +510,6 @@ Main_Freqplots_Activate( void )
   }
 
   /* Enable freq data graph plotting */
-  calc_data.zo = 50.0;
   SetFlag( PLOT_ENABLED );
 
   return( TRUE );
@@ -752,15 +835,15 @@ Alloc_Crnt_Buffs( void )
   if( data.m > 0 )
   {
 	size_t mreq = (size_t)data.m * sizeof( double );
-	mem_realloc( (void *)&ct1m, mreq, "in callback_func.c" );
-	mem_realloc( (void *)&ct2m, mreq, "in callback_func.c" );
+	mem_realloc( (void **)&ct1m, mreq, "in callback_func.c" );
+	mem_realloc( (void **)&ct2m, mreq, "in callback_func.c" );
   }
 
   /* Segment currents buffer */
   if( data.n > 0 )
   {
 	size_t mreq = (size_t)data.n * sizeof( double );
-	mem_realloc( (void *)&cmag, mreq, "in callback_func.c" );
+	mem_realloc( (void **)&cmag, mreq, "in callback_func.c" );
   }
 
 } /* Alloc_Crnt_Buffs() */
@@ -774,9 +857,9 @@ Alloc_Crnt_Buffs( void )
   void
 Free_Crnt_Buffs( void )
 {
-  free_ptr( (void *)&ct1m );
-  free_ptr( (void *)&ct2m );
-  free_ptr( (void *)&cmag );
+  free_ptr( (void **)&ct1m );
+  free_ptr( (void **)&ct2m );
+  free_ptr( (void **)&cmag );
 } /* Free_Crnt_Buffs() */
 
 /*-----------------------------------------------------------------------*/
diff --git a/src/callbacks.c b/src/callbacks.c
index 9b2ec1e..3dcd572 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -124,6 +124,7 @@ on_main_save_activate        (GtkMenuItem     *menuitem,
 							  gpointer         user_data)
 {
   char saveas[96];
+  size_t s = sizeof( saveas );
 
   /* Count number of structure image files saved of geometry,
    * currents or charges, to avoid over-writing saved files */
@@ -135,12 +136,11 @@ on_main_save_activate        (GtkMenuItem     *menuitem,
   /* Make the structure image save file name from input file
    * name. The count of each image type saved is incremented */
   if( isFlagSet(DRAW_CURRENTS) )
-	snprintf( saveas, 95, "%s-%s_%03d.%s", infile, "current", ++ccr, "png" );
+	snprintf( saveas, s, "%s-%s_%03d.%s", infile, "current", ++ccr, "png" );
   else if( isFlagSet(DRAW_CHARGES) )
-	snprintf( saveas, 95, "%s-%s_%03d.%s", infile, "charge", ++cch, "png" );
+	snprintf( saveas, s, "%s-%s_%03d.%s", infile, "charge", ++cch, "png" );
   else
-	snprintf( saveas, 95, "%s-%s_%03d.%s", infile, "geometry", ++cgm, "png" );
-  saveas[95] = '\0';
+	snprintf( saveas, s, "%s-%s_%03d.%s", infile, "geometry", ++cgm, "png" );
 
   saveas_pixmap = structure_pixmap;
   saveas_pixmap_width  = structure_pixmap_width;
@@ -221,7 +221,7 @@ on_main_rdpattern_activate             (GtkMenuItem     *menuitem,
 		  rdpattern_window, "rdpattern_incline_spinbutton"));
 	rdpattern_frequency = GTK_SPIN_BUTTON(lookup_widget(
 		  rdpattern_window, "rdpattern_freq_spinbutton"));
-	rdpattern_zoom_spinbutton = GTK_SPIN_BUTTON(lookup_widget(
+	rdpattern_zoom = GTK_SPIN_BUTTON(lookup_widget(
 		  rdpattern_window, "rdpattern_zoom_spinbutton"));
 	rdpattern_fstep_entry = GTK_ENTRY(lookup_widget(
 		  rdpattern_window, "rdpattern_fstep_entry")) ;
@@ -305,7 +305,20 @@ on_common_projection_activate          (GtkMenuItem     *menuitem,
   /* Enable syncing of projection params
    * for structure and rad pattern drawing */
   if( gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)) )
+  {
+	if( isFlagSet(DRAW_ENABLED) )
+	{
+	  rdpattern_proj_params.Wr = structure_proj_params.Wr;
+	  rdpattern_proj_params.Wi = structure_proj_params.Wi;
+	  New_Viewer_Angle(
+		  rdpattern_proj_params.Wr,
+		  rdpattern_proj_params.Wi,
+		  rotate_rdpattern,
+		  incline_rdpattern,
+		  &rdpattern_proj_params );
+	}
 	SetFlag( COMMON_PROJECTION );
+  }
   else
 	ClearFlag( COMMON_PROJECTION );
 }
@@ -332,6 +345,9 @@ on_main_x_axis_clicked                 (GtkButton       *button,
   /* Recalculate projection paramenters */
   New_Viewer_Angle( 0.0, 0.0, rotate_structure,
 	  incline_structure, &structure_proj_params );
+  if( isFlagSet(DRAW_ENABLED) && isFlagSet(COMMON_PROJECTION) )
+	New_Viewer_Angle( 0.0, 0.0, rotate_rdpattern,
+		incline_rdpattern, &rdpattern_proj_params );
 }
 
 
@@ -342,6 +358,9 @@ on_main_y_axis_clicked                 (GtkButton       *button,
   /* Recalculate projection paramenters */
   New_Viewer_Angle( 90.0, 0.0, rotate_structure,
 	  incline_structure, &structure_proj_params );
+  if( isFlagSet(DRAW_ENABLED) && isFlagSet(COMMON_PROJECTION) )
+	New_Viewer_Angle( 90.0, 0.0, rotate_rdpattern,
+		incline_rdpattern, &rdpattern_proj_params );
 }
 
 
@@ -352,6 +371,9 @@ on_main_z_axis_clicked                 (GtkButton       *button,
   /* Recalculate projection paramenters */
   New_Viewer_Angle( 0.0, 90.0, rotate_structure,
 	  incline_structure, &structure_proj_params );
+  if( isFlagSet(DRAW_ENABLED) && isFlagSet(COMMON_PROJECTION) )
+	New_Viewer_Angle( 0.0, 90.0, rotate_rdpattern,
+		incline_rdpattern, &rdpattern_proj_params );
 }
 
 
@@ -362,38 +384,53 @@ on_main_default_view_clicked           (GtkButton       *button,
   /* Projection at 45 deg rotation and inclination */
   New_Viewer_Angle( 45.0, 45.0, rotate_structure,
 	  incline_structure, &structure_proj_params );
+  if( isFlagSet(DRAW_ENABLED) && isFlagSet(COMMON_PROJECTION) )
+	New_Viewer_Angle( 45.0, 45.0, rotate_rdpattern,
+		incline_rdpattern, &rdpattern_proj_params );
 }
 
 
 void
-on_main_rotate_spinbutton_value_changed(GtkSpinButton   *spinbutton,
-										gpointer         user_data)
+on_main_rotate_spinbutton_value_changed(
+	GtkSpinButton   *spinbutton,
+	gpointer         user_data)
 {
-  gtk_spin_button_update( spinbutton );
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return;
+
   /* Get new "rotate" structure angle from spinbutton */
   structure_proj_params.Wr = gtk_spin_button_get_value(spinbutton);
-  New_Structure_Projection_Angle();
 
   /* Sync rad pattrern window spinbutton if enabled */
   if( isFlagSet(DRAW_ENABLED) && isFlagSet(COMMON_PROJECTION) )
 	gtk_spin_button_set_value(
 		rotate_rdpattern, (gdouble)structure_proj_params.Wr );
+
+  New_Structure_Projection_Angle();
+  gtk_spin_button_update( spinbutton );
 }
 
 
-void
-on_main_incline_spinbutton_value_changed( GtkSpinButton   *spinbutton,
-										  gpointer         user_data)
+  void
+on_main_incline_spinbutton_value_changed(
+	GtkSpinButton   *spinbutton,
+	gpointer         user_data)
 {
-  gtk_spin_button_update( spinbutton );
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return;
+
   /* Get new "incline" structure angle from spinbutton */
   structure_proj_params.Wi = gtk_spin_button_get_value(spinbutton);
-  New_Structure_Projection_Angle();
 
   /* Sync rad pattrern window spinbutton if enabled */
   if( isFlagSet(DRAW_ENABLED) && isFlagSet(COMMON_PROJECTION) )
 	gtk_spin_button_set_value(
 		incline_rdpattern, (gdouble)structure_proj_params.Wi );
+
+  New_Structure_Projection_Angle();
+  gtk_spin_button_update( spinbutton );
 }
 
 
@@ -450,7 +487,9 @@ on_main_freq_spinbutton_value_changed  (GtkSpinButton   *spinbutton,
 {
   static gdouble fmhz_save = 0.0;
 
-  gtk_spin_button_update( spinbutton );
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return;
 
   /* Frequency spinbutton value changed by frequency loop */
   if( isFlagSet(FREQ_LOOP_RUNNING) )
@@ -481,9 +520,12 @@ on_main_freq_spinbutton_value_changed  (GtkSpinButton   *spinbutton,
 	if( isFlagSet(DRAW_ENABLED) 	&&
 		isFlagSet(COMMON_FREQUENCY) &&
 		isFlagSet(MAIN_NEW_FREQ) )
+	  /* Show current frequency */
 	  gtk_spin_button_set_value( rdpattern_frequency, fmhz );
 
   } /* else */
+
+  gtk_spin_button_update( spinbutton );
 }
 
 
@@ -533,8 +575,27 @@ on_structure_drawingarea_motion_notify_event( GtkWidget       *widget,
 											  GdkEventMotion  *event,
 											  gpointer         user_data)
 {
-  Motion_Event( event, &structure_proj_params,
-	  rotate_structure, incline_structure );
+  /* Use only 1 in MOTION_EVENTS_COUNT event */
+  static int cnt = 0;
+  if( cnt++ < MOTION_EVENTS_COUNT )
+	return FALSE;
+  cnt = 0;
+
+  /* Block motion events */
+  g_signal_handler_block
+	( (gpointer)structure_drawingarea, structure_motion_handler );
+
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return FALSE;
+
+  /* Handle motion events */
+  Motion_Event( event, &structure_proj_params );
+
+  /* Unblock motion events */
+  g_signal_handler_unblock(
+	  (gpointer)structure_drawingarea, structure_motion_handler );
+
   return TRUE;
 }
 
@@ -569,7 +630,7 @@ on_filechooserdialog_response          (GtkDialog       *dialog,
 	/* Get filename of NEC2 input file */
 	filename =
 	  gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) );
-	Strlcpy( infile, filename, strlen(filename)+1 ); /* For null term. */
+	Strlcpy( infile, filename, sizeof(infile) );
 	g_free( filename );
 	gtk_widget_destroy( file_chooser );
 
@@ -593,7 +654,8 @@ on_fileselection_response(  GtkDialog       *dialog,
   if( response_id == GTK_RESPONSE_OK )
   {
 	/* Get the "save as" file name */
-	Strlcpy( filename, gtk_file_selection_get_filename(
+	Strlcpy( filename,
+		gtk_file_selection_get_filename(
 		  GTK_FILE_SELECTION(dialog)), s );
 
 	if( isFlagSet(IMAGE_SAVE) )
@@ -614,7 +676,7 @@ on_fileselection_response(  GtkDialog       *dialog,
 		Strlcat( filename, ".nec", s );
 
 	  /* Use new file name as input file */
-	  Strlcpy( infile, filename, strlen(filename)+1 );
+	  Strlcpy( infile, filename, sizeof(infile) );
 	  Save_Nec2_Input_File( nec2_edit_window, filename );
 
 	  /* Re-open NEC2 input file */
@@ -678,6 +740,7 @@ on_freqplots_save_activate             (GtkMenuItem     *menuitem,
 										gpointer         user_data)
 {
   char saveas[96];
+  size_t s = sizeof( saveas );
   static int cnt = 0;
 
   if( (strlen(infile) == 0) || isFlagClear(PLOT_SELECT) )
@@ -685,9 +748,7 @@ on_freqplots_save_activate             (GtkMenuItem     *menuitem,
 
   /* Make file name from input file name,
    * to save frequency plots drawing */
-  snprintf( saveas, 95, "%s-%s_%03d.%s", infile, "plots", ++cnt, "png" );
-  saveas[95] = '\0';
-
+  snprintf( saveas, s, "%s-%s_%03d.%s", infile, "plots", ++cnt, "png" );
   saveas_pixmap = freqplots_pixmap;
   saveas_pixmap_width  = freqplots_pixmap_width;
   saveas_pixmap_height = freqplots_pixmap_height;
@@ -772,11 +833,11 @@ void
 on_freqplots_zo_spinbutton_value_changed( GtkSpinButton   *spinbutton,
 										  gpointer         user_data)
 {
-  gtk_spin_button_update( spinbutton );
   /* Set the value of Z0 used for VSWR calculations */
   calc_data.zo = gtk_spin_button_get_value(spinbutton);
   if( isFlagSet(PLOT_ENABLED) )
 	Plot_Frequency_Data();
+  gtk_spin_button_update( spinbutton );
 }
 
 
@@ -833,6 +894,10 @@ on_freqplots_drawingarea_button_press_event(GtkWidget       *widget,
 											GdkEventButton  *event,
 											gpointer         user_data)
 {
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return FALSE;
+
   Set_Frequency_On_Click( event );
   return TRUE;
 }
@@ -862,6 +927,7 @@ on_rdpattern_save_activate             (GtkMenuItem     *menuitem,
 										gpointer         user_data)
 {
   char saveas[96];
+  size_t s = sizeof( saveas );
   static int cgn = 0, ceh = 0;;
 
   if( strlen(infile) == 0 )
@@ -870,11 +936,10 @@ on_rdpattern_save_activate             (GtkMenuItem     *menuitem,
   /* Make the rad pattern save
    * file name from input name */
   if( isFlagSet(DRAW_GAIN) )
-	snprintf( saveas, 95, "%s-%s_%03d.%s", infile, "gain", ++cgn, "png" );
+	snprintf( saveas, s, "%s-%s_%03d.%s", infile, "gain", ++cgn, "png" );
   else if( isFlagSet(DRAW_EHFIELD) )
-	snprintf( saveas, 95, "%s-%s_%03d.%s", infile, "fields", ++ceh, "png" );
+	snprintf( saveas, s, "%s-%s_%03d.%s", infile, "fields", ++ceh, "png" );
   else return;
-  saveas[95] = '\0';
 
   saveas_pixmap = rdpattern_pixmap;
   saveas_pixmap_width  = rdpattern_pixmap_width;
@@ -1017,6 +1082,9 @@ on_rdpattern_x_axis_clicked            (GtkButton       *button,
   /* Recalculate projection paramenters */
   New_Viewer_Angle( 0.0, 0.0, rotate_rdpattern,
 	  incline_rdpattern, &rdpattern_proj_params );
+  if( isFlagSet(COMMON_PROJECTION) )
+	New_Viewer_Angle( 0.0, 0.0, rotate_structure,
+		incline_structure, &structure_proj_params );
 }
 
 
@@ -1027,6 +1095,9 @@ on_rdpattern_y_axis_clicked            (GtkButton       *button,
   /* Recalculate projection paramenters */
   New_Viewer_Angle( 90.0, 0.0, rotate_rdpattern,
 	  incline_rdpattern, &rdpattern_proj_params );
+  if( isFlagSet(COMMON_PROJECTION) )
+	New_Viewer_Angle( 90.0, 0.0, rotate_structure,
+		incline_structure, &structure_proj_params );
 }
 
 
@@ -1037,52 +1108,67 @@ on_rdpattern_z_axis_clicked            (GtkButton       *button,
   /* Recalculate projection paramenters */
   New_Viewer_Angle( 0.0, 90.0, rotate_rdpattern,
 	  incline_rdpattern, &rdpattern_proj_params );
+  if( isFlagSet(COMMON_PROJECTION) )
+	New_Viewer_Angle( 0.0, 90.0, rotate_structure,
+		incline_structure, &structure_proj_params );
 }
 
 
   void
-on_rdpattern_default_view_clicked      (GtkButton       *button,
-										gpointer         user_data)
+on_rdpattern_default_view_clicked
+  (GtkButton       *button,
+  gpointer         user_data)
 {
   /* Projection at 45 deg rotation and inclination */
   New_Viewer_Angle( 45.0, 45.0, rotate_rdpattern,
 	  incline_rdpattern, &rdpattern_proj_params );
+  if( isFlagSet(COMMON_PROJECTION) )
+	New_Viewer_Angle( 45.0, 45.0, rotate_structure,
+		incline_structure, &structure_proj_params );
 }
 
 
 void
-on_rdpattern_rotate_spinbutton_value_changed(GtkSpinButton   *spinbutton,
-											  gpointer         user_data)
+on_rdpattern_rotate_spinbutton_value_changed(
+	GtkSpinButton   *spinbutton,
+	gpointer         user_data)
 {
-  gtk_spin_button_update( spinbutton );
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return;
 
   /* Get new value of "rotate pattern" angle from spinbutton */
   rdpattern_proj_params.Wr = gtk_spin_button_get_value(spinbutton);
-  New_Radiation_Projection_Angle();
 
   /* Sync main window rotate spinbutton */
   if( isFlagSet(COMMON_PROJECTION) )
-	gtk_spin_button_set_value( GTK_SPIN_BUTTON(lookup_widget(
-			main_window, "main_rotate_spinbutton")),
-		(gdouble)rdpattern_proj_params.Wr );
+	gtk_spin_button_set_value(
+		rotate_structure, (gdouble)rdpattern_proj_params.Wr );
+
+  New_Radiation_Projection_Angle();
+  gtk_spin_button_update( spinbutton );
 }
 
 
 void
-on_rdpattern_incline_spinbutton_value_changed(GtkSpinButton   *spinbutton,
-											  gpointer         user_data)
+on_rdpattern_incline_spinbutton_value_changed(
+	GtkSpinButton   *spinbutton,
+	gpointer         user_data)
 {
-  gtk_spin_button_update( spinbutton );
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return;
 
   /* Get new value of "incline pattern" angle from spinbutton */
   rdpattern_proj_params.Wi = gtk_spin_button_get_value(spinbutton);
-  New_Radiation_Projection_Angle();
 
   /* Sync main window incline spinbutton */
   if( isFlagSet(COMMON_PROJECTION) )
-	gtk_spin_button_set_value( GTK_SPIN_BUTTON(lookup_widget(
-			main_window, "main_incline_spinbutton")),
-		(gdouble)rdpattern_proj_params.Wi );
+	gtk_spin_button_set_value(
+		incline_structure, (gdouble)rdpattern_proj_params.Wi );
+
+  New_Radiation_Projection_Angle();
+  gtk_spin_button_update( spinbutton );
 }
 
 
@@ -1137,7 +1223,9 @@ on_rdpattern_freq_spinbutton_value_changed(	GtkSpinButton   *spinbutton,
 {
   static gdouble fmhz_save = 0.0;
 
-  gtk_spin_button_update( spinbutton );
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return;
 
   /* Frequency spinbutton value changed by frequency loop */
   if( isFlagSet(FREQ_LOOP_RUNNING) && isFlagSet(DRAW_ENABLED) )
@@ -1165,6 +1253,7 @@ on_rdpattern_freq_spinbutton_value_changed(	GtkSpinButton   *spinbutton,
 	if( isFlagSet(COMMON_FREQUENCY) )
 	  gtk_spin_button_set_value( mainwin_frequency, fmhz );
   } /* else */
+  gtk_spin_button_update( spinbutton );
 }
 
 
@@ -1217,8 +1306,27 @@ on_rdpattern_drawingarea_motion_notify_event( GtkWidget       *widget,
 											  GdkEventMotion  *event,
 											  gpointer         user_data)
 {
-  Motion_Event( event, &rdpattern_proj_params,
-	  rotate_rdpattern, incline_rdpattern );
+  /* Use only 1 in MOTION_EVENTS_COUNT event */
+  static int cnt = 0;
+  if( cnt++ < MOTION_EVENTS_COUNT )
+	return FALSE;
+  cnt = 0;
+
+  /* Block motion events */
+  g_signal_handler_block(
+	  (gpointer)rdpattern_drawingarea, rdpattern_motion_handler );
+
+  /* No redraws if new input pending */
+  if( isFlagSet(INPUT_PENDING) )
+	return FALSE;
+
+  /* Handle motion events */
+  Motion_Event( event, &rdpattern_proj_params );
+
+  /* Unblock motion events */
+  g_signal_handler_unblock(
+	  (gpointer)rdpattern_drawingarea, rdpattern_motion_handler );
+
   return TRUE;
 }
 
@@ -3550,10 +3658,10 @@ on_structure_plus_button_clicked       (GtkButton       *button,
                                         gpointer         user_data)
 {
   structure_proj_params.xy_zoom =
-	gtk_spin_button_get_value( structure_zoom_spinbutton );
+	gtk_spin_button_get_value( structure_zoom );
   structure_proj_params.xy_zoom *= 1.1;
   gtk_spin_button_set_value(
-	  structure_zoom_spinbutton, structure_proj_params.xy_zoom );
+	  structure_zoom, structure_proj_params.xy_zoom );
 }
 
 
@@ -3562,10 +3670,10 @@ on_structure_minus_button_clicked      (GtkButton       *button,
                                         gpointer         user_data)
 {
   structure_proj_params.xy_zoom =
-	gtk_spin_button_get_value( structure_zoom_spinbutton );
+	gtk_spin_button_get_value( structure_zoom );
   structure_proj_params.xy_zoom /= 1.1;
   gtk_spin_button_set_value(
-	  structure_zoom_spinbutton, structure_proj_params.xy_zoom );
+	  structure_zoom, structure_proj_params.xy_zoom );
 }
 
 
@@ -3573,7 +3681,7 @@ void
 on_structure_one_button_clicked        (GtkButton       *button,
                                         gpointer         user_data)
 {
-  gtk_spin_button_set_value( structure_zoom_spinbutton, 100.0 );
+  gtk_spin_button_set_value( structure_zoom, 100.0 );
   structure_proj_params.reset = TRUE;
   New_Projection_Parameters(
 	  structure_pixmap_width,
@@ -3614,10 +3722,10 @@ on_rdpattern_plus_button_clicked       (GtkButton       *button,
                                         gpointer         user_data)
 {
   rdpattern_proj_params.xy_zoom =
-	gtk_spin_button_get_value( rdpattern_zoom_spinbutton );
+	gtk_spin_button_get_value( rdpattern_zoom );
   rdpattern_proj_params.xy_zoom *= 1.1;
   gtk_spin_button_set_value(
-	  rdpattern_zoom_spinbutton, rdpattern_proj_params.xy_zoom );
+	  rdpattern_zoom, rdpattern_proj_params.xy_zoom );
 }
 
 
@@ -3626,10 +3734,10 @@ on_rdpattern_minus_button_clicked      (GtkButton       *button,
                                         gpointer         user_data)
 {
   rdpattern_proj_params.xy_zoom =
-	gtk_spin_button_get_value( rdpattern_zoom_spinbutton );
+	gtk_spin_button_get_value( rdpattern_zoom );
   rdpattern_proj_params.xy_zoom /= 1.1;
   gtk_spin_button_set_value(
-	  rdpattern_zoom_spinbutton, rdpattern_proj_params.xy_zoom );
+	  rdpattern_zoom, rdpattern_proj_params.xy_zoom );
 }
 
 
@@ -3637,7 +3745,7 @@ void
 on_rdpattern_one_button_clicked        (GtkButton       *button,
                                         gpointer         user_data)
 {
-  gtk_spin_button_set_value( rdpattern_zoom_spinbutton, 100.0 );
+  gtk_spin_button_set_value( rdpattern_zoom, 100.0 );
   rdpattern_proj_params.reset = TRUE;
   New_Projection_Parameters(
 	  rdpattern_pixmap_width,
@@ -3653,13 +3761,13 @@ on_structure_drawingarea_scroll_event  (GtkWidget       *widget,
 										gpointer         user_data)
 {
   structure_proj_params.xy_zoom =
-	gtk_spin_button_get_value( structure_zoom_spinbutton );
+	gtk_spin_button_get_value( structure_zoom );
   if( event->scroll.direction == GDK_SCROLL_UP )
 	structure_proj_params.xy_zoom *= 1.1;
   else if( event->scroll.direction == GDK_SCROLL_DOWN )
 	structure_proj_params.xy_zoom /= 1.1;
   gtk_spin_button_set_value(
-	  structure_zoom_spinbutton, structure_proj_params.xy_zoom );
+	  structure_zoom, structure_proj_params.xy_zoom );
   return FALSE;
 }
 
@@ -3670,13 +3778,13 @@ on_rdpattern_drawingarea_scroll_event  (GtkWidget       *widget,
                                         gpointer         user_data)
 {
   rdpattern_proj_params.xy_zoom =
-	gtk_spin_button_get_value( rdpattern_zoom_spinbutton );
+	gtk_spin_button_get_value( rdpattern_zoom );
   if( event->scroll.direction == GDK_SCROLL_UP )
 	rdpattern_proj_params.xy_zoom *= 1.1;
   else if( event->scroll.direction == GDK_SCROLL_DOWN )
 	rdpattern_proj_params.xy_zoom /= 1.1;
   gtk_spin_button_set_value(
-	  rdpattern_zoom_spinbutton, rdpattern_proj_params.xy_zoom );
+	  rdpattern_zoom, rdpattern_proj_params.xy_zoom );
   return FALSE;
 }
 
diff --git a/src/cmnd_edit.c b/src/cmnd_edit.c
index 3fb42aa..877004d 100644
--- a/src/cmnd_edit.c
+++ b/src/cmnd_edit.c
@@ -2310,7 +2310,7 @@ Kernel_Command( int action )
 	if( gtk_list_store_iter_is_valid(cmnd_store, &iter_ek) )
 	{
 	  /* Set extended kernel data */
-	  snprintf( sek, 6, "%5d", ek );
+	  snprintf( sek, sizeof(sek), "%5d", ek );
 	  gtk_list_store_set(
 		  cmnd_store, &iter_ek, CMND_COL_I1, sek, -1 );
 
@@ -2494,7 +2494,7 @@ Intrange_Command( int action )
   spin = GTK_SPIN_BUTTON(lookup_widget(
 		intrange_command, "intrange_wlen_spinbutton") );
   kh = gtk_spin_button_get_value( spin );
-  snprintf( skh, 13, "%12.5e", kh );
+  snprintf( skh, sizeof(skh), "%12.5e", kh );
 
   /* Wait for GTK to complete its tasks */
   while( g_main_context_iteration(NULL, FALSE) );
@@ -2550,7 +2550,7 @@ Execute_Command( int action )
 	/* Set XQ card data */
 	if( gtk_list_store_iter_is_valid(cmnd_store, &iter_xq) )
 	{
-	  snprintf( sxq, 6, "%5d", xq );
+	  snprintf( sxq, sizeof(sxq), "%5d", xq );
 	  gtk_list_store_set(
 		  cmnd_store, &iter_xq, CMND_COL_I1, sxq, -1 );
 	  for( idc = CMND_COL_I2; idc <= CMND_COL_F6; idc++ )
diff --git a/src/common.h b/src/common.h
index 0aa4bcd..a8967a4 100644
--- a/src/common.h
+++ b/src/common.h
@@ -65,6 +65,9 @@
 /* Max length of a line read from input file */
 #define	LINE_LEN	135
 
+/* Size of char arrays (strings) for error messages etc */
+#define MESG_SIZE	128
+
 /* Type of projection parameters stuct */
 #define	STRUCTURE_DRAWINGAREA	1
 #define	RDPATTERN_DRAWINGAREA	2
@@ -700,8 +703,9 @@ void zint(double sigl, double rolam, _Complex double *zint);
 /* callback_func.c */
 void Save_Pixmap(GdkPixmap *pixmap, int pixmap_width, int pixmap_height, char *filename);
 void New_Viewer_Angle(double wr, double wi, GtkSpinButton *wr_spb, GtkSpinButton *wi_spb, projection_parameters_t *params);
+void Set_Spin_Button(GtkSpinButton *spin, gdouble value);
 void Create_Pixmap(GdkPixmap **pixmap, int *pixmap_width, int *pixmap_height, GtkWidget *widget, GdkEventConfigure *event, projection_parameters_t *params);
-void Motion_Event(GdkEventMotion *event, projection_parameters_t *params, GtkSpinButton *wr_spb, GtkSpinButton *wi_spb);
+void Motion_Event(GdkEventMotion *event, projection_parameters_t *params);
 void Plot_Select(GtkToggleButton *togglebutton, unsigned long long int flag);
 void Delete_Event(gchar *message);
 void Set_Pol_Menuitem(GtkMenuItem *menuitem);
@@ -1283,7 +1287,7 @@ void ToggleFlag(unsigned long long int flag);
 void SaveFlag(unsigned long long int *flag, unsigned long long int mask);
 void Strlcpy(char *dest, const char *src, size_t n);
 void Strlcat(char *dest, const char *src, size_t n);
-double Strtod(const char *nptr, char **endptr);
+double Strtod(char *nptr, char **endptr);
 /* xnec2c.c */
 void Frequency_Scale_Geometry(void);
 void Structure_Impedance_Loading(void);
diff --git a/src/draw_radiation.c b/src/draw_radiation.c
index c5251e6..313a2e5 100644
--- a/src/draw_radiation.c
+++ b/src/draw_radiation.c
@@ -40,10 +40,6 @@ static point_3d_t *point_3d = NULL;
   void
 Draw_Radiation( GtkWidget *drawingarea )
 {
-  /* Block motion events */
-  g_signal_handler_block(
-	  (gpointer)drawingarea, rdpattern_motion_handler );
-
   /* Abort if xnec2c may be quit by user */
   if( isFlagSet(MAIN_QUIT) || isFlagClear(ENABLE_EXCITN) )
 	return;
@@ -77,11 +73,6 @@ Draw_Radiation( GtkWidget *drawingarea )
   while( g_main_context_iteration(NULL, FALSE) );
 
   cairo_destroy( cr );
-
-  /* Unblock motion events */
-  g_signal_handler_unblock(
-	  (gpointer)drawingarea, rdpattern_motion_handler );
-
 } /* Draw_Radiation() */
 
 /*-----------------------------------------------------------------------*/
@@ -103,6 +94,7 @@ Draw_Radiation_Pattern( void )
   GdkSegment segm;
 
   int
+	idx,
 	nth,     /* Theta step count */
 	nph,     /* Phi step count   */
 	col_idx, /* Index to rad pattern color buffers */
@@ -133,24 +125,24 @@ Draw_Radiation_Pattern( void )
   if( isFlagSet(DRAW_NEW_RDPAT) )
   {
 	size_t mreq = ((size_t)(fpat.nth * fpat.nph)) * sizeof(point_3d_t);
-	mem_realloc( (void *)&point_3d, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&point_3d, mreq, "in draw_radiation.c" );
 	mreq = (size_t)((fpat.nth-1) * fpat.nph + (fpat.nph-1) * fpat.nth);
 	mreq *= sizeof(double);
-	mem_realloc( (void *)&red, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&grn, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&blu, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&red, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&grn, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&blu, mreq, "in draw_radiation.c" );
 
 	ClearFlag( DRAW_NEW_RDPAT );
 
 	/* Distance of rdpattern point furthest from xyz origin */
+	idx = rad_pattern[fstep].max_gain_idx[pol];
 	rdpattern_proj_params.r_max = Scale_Gain(
-		rad_pattern[fstep].gtot[rad_pattern[fstep].max_gain_idx[pol]],
-		fstep, rad_pattern[fstep].max_gain_idx[pol]);
+		rad_pattern[fstep].gtot[idx], fstep, idx);
 
 	/* Distance of rdpattern point nearest to xyz origin */
+	idx = rad_pattern[fstep].min_gain_idx[pol];
 	r_min = Scale_Gain(
-		rad_pattern[fstep].gtot[rad_pattern[fstep].min_gain_idx[pol]],
-		fstep, rad_pattern[fstep].min_gain_idx[pol]);
+		rad_pattern[fstep].gtot[idx], fstep, idx);
 
 	/* Range of scaled rdpattern gain values */
 	r_range = rdpattern_proj_params.r_max - r_min;
@@ -243,14 +235,12 @@ Draw_Radiation_Pattern( void )
 
 	/* Show max gain on color code bar */
 	snprintf( txt, 7, "%6f", rad_pattern[fstep].max_gain[pol] );
-	txt[6] = '\0';
 	gtk_label_set_text(
 		GTK_LABEL(lookup_widget(rdpattern_window,
 			"rdpattern_colorcode_maxlabel")), txt );
 
 	/* Show min gain on color code bar */
 	snprintf( txt, 5, "%4f", rad_pattern[fstep].min_gain[pol] );
-	txt[6] = '\0';
 	gtk_label_set_text(
 		GTK_LABEL(lookup_widget(rdpattern_window,
 			"rdpattern_colorcode_minlabel")), txt );
@@ -520,10 +510,10 @@ Draw_Near_Field( void )
 	  if( isFlagSet(ALLOC_PNTING_BUFF) )
 	  {
 		size_t mreq = (size_t)npts * sizeof( double );
-		mem_realloc( (void *)&pov_x, mreq, "in draw_radiation.c" );
-		mem_realloc( (void *)&pov_y, mreq, "in draw_radiation.c" );
-		mem_realloc( (void *)&pov_z, mreq, "in draw_radiation.c" );
-		mem_realloc( (void *)&pov_r, mreq, "in draw_radiation.c" );
+		mem_realloc( (void **)&pov_x, mreq, "in draw_radiation.c" );
+		mem_realloc( (void **)&pov_y, mreq, "in draw_radiation.c" );
+		mem_realloc( (void **)&pov_z, mreq, "in draw_radiation.c" );
+		mem_realloc( (void **)&pov_r, mreq, "in draw_radiation.c" );
 		ClearFlag( ALLOC_PNTING_BUFF );
 	  }
 
@@ -592,7 +582,7 @@ Draw_Near_Field( void )
   else if( isFlagSet(DRAW_POYNTING) )
 	max = pov_max;
 
-  snprintf( txt, 9, "%8.2E", max );
+  snprintf( txt, sizeof(txt), "%8.2E", max );
   gtk_label_set_text(
 	  GTK_LABEL(lookup_widget(rdpattern_window,
 		  "rdpattern_colorcode_maxlabel")), txt );
@@ -683,12 +673,9 @@ static int gain_style = GS_LINP;
 Scale_Gain( double gain, int fstep, int idx )
 {
   /* Scaled rad pattern gain and pol factor */
-  double scaled_rad = 0.0, polf;
+  double scaled_rad = 0.0;
 
-  polf = Polarization_Factor( calc_data.pol_type, fstep, idx );
-  if ( polf< 1e-200 ) return( 0.0 );
-
-  gain += 10.0 * log10(polf);
+  gain += Polarization_Factor( calc_data.pol_type, fstep, idx );
 
   switch( gain_style )
   {
@@ -763,8 +750,10 @@ Polarization_Factor( int pol_type, int fstep, int idx )
 	  polf  = (1.0 - 2.0 * axrt + axrt2) / 2.0 / (1.0 + axrt2);
   }
 
+  if( polf < 1.0E-200 ) polf = 1.0E-200;
+  polf = 10.0 * log10( polf );
+  
   return( polf );
-
 } /* Polarization_Factor() */
 
 /*-----------------------------------------------------------------------*/
@@ -880,41 +869,43 @@ Viewer_Gain( projection_parameters_t proj_parameters, int fstep )
 {
   double phi, gain;
   int nth, nph, idx;
-
-
+  
   /* Calculate theta step from proj params */
   phi = proj_parameters.Wr;
-  if( fpat.dth == 0.0 )
-	nth = 0;
+  if( fpat.dth == 0.0 ) nth = 0;
   else
   {
-	double theta = fabs( 90.0 - proj_parameters.Wi );
+	double theta;
+	theta = fabs( 90.0 - proj_parameters.Wi );
 	if( theta > 180.0 )
 	{
 	  theta = 360.0 - theta;
 	  phi  -= 180.0;
 	}
-	if( (gnd.ksymp == 2) && (theta > 90.01) && (gnd.ifar != 1) )
+
+	if( (gnd.ksymp == 2) &&
+		(theta > 90.01)  &&
+		(gnd.ifar != 1) )
 	  return( -999.99 );
-	nth = (int)( theta/fpat.dth + 0.5 );
+
+	nth = (int)( (theta - fpat.thets) / fpat.dth + 0.5 );
 	if( (nth >= fpat.nth) || (nth < 0) )
 	  nth = fpat.nth-1;
   }
 
   /* Calculate phi step from proj params */
-  if( fpat.dph == 0.0 )
-	nph = 0;
+  if( fpat.dph == 0.0 ) nph = 0;
   else
   {
 	while( phi < 0.0 ) phi += 360.0;
-	nph = (int)( phi/fpat.dph + 0.5 );
+	nph = (int)( (phi - fpat.phis) / fpat.dph + 0.5 );
 	if( (nph >= fpat.nph) || (nph < 0) )
 	  nph = fpat.nph-1;
   }
 
-  idx = nth + nph*fpat.nth;
+  idx = nth + nph * fpat.nth;
   gain = rad_pattern[fstep].gtot[idx] +
-		10.0 * log10( Polarization_Factor(calc_data.pol_type, fstep, idx) );
+		Polarization_Factor(calc_data.pol_type, fstep, idx);
   if( gain < -999.99 ) gain = -999.99;
 
   return( gain );
@@ -1036,53 +1027,52 @@ Alloc_Rdpattern_Buffers( int nfrq, int nth, int nph )
   /* Free old gain buffers first */
   for( idx = 0; idx < last_nfrq; idx++ )
   {
-	free_ptr( (void *)&rad_pattern[idx].gtot );
-	free_ptr( (void *)&rad_pattern[idx].max_gain );
-	free_ptr( (void *)&rad_pattern[idx].min_gain );
-	free_ptr( (void *)&rad_pattern[idx].max_gain_tht );
-	free_ptr( (void *)&rad_pattern[idx].max_gain_phi );
-	free_ptr( (void *)&rad_pattern[idx].max_gain_idx );
-	free_ptr( (void *)&rad_pattern[idx].min_gain_idx );
-	free_ptr( (void *)&rad_pattern[idx].axrt );
-	free_ptr( (void *)&rad_pattern[idx].tilt );
-	free_ptr( (void *)&rad_pattern[idx].sens );
+	free_ptr( (void **)&rad_pattern[idx].gtot );
+	free_ptr( (void **)&rad_pattern[idx].max_gain );
+	free_ptr( (void **)&rad_pattern[idx].min_gain );
+	free_ptr( (void **)&rad_pattern[idx].max_gain_tht );
+	free_ptr( (void **)&rad_pattern[idx].max_gain_phi );
+	free_ptr( (void **)&rad_pattern[idx].max_gain_idx );
+	free_ptr( (void **)&rad_pattern[idx].min_gain_idx );
+	free_ptr( (void **)&rad_pattern[idx].axrt );
+	free_ptr( (void **)&rad_pattern[idx].tilt );
+	free_ptr( (void **)&rad_pattern[idx].sens );
   }
   last_nfrq = nfrq;
 
   /* Allocate rad pattern buffers */
   mreq = (size_t)nfrq * sizeof(rad_pattern_t);
-  mem_realloc( (void *)&rad_pattern, mreq, "in draw_radiation.c" );
-
+  mem_realloc( (void **)&rad_pattern, mreq, "in draw_radiation.c" );
   for( idx = 0; idx < nfrq; idx++ )
   {
 	/* Memory request for allocs */
 	mreq = (size_t)(nph * nth) * sizeof(double);
 	rad_pattern[idx].gtot = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].gtot, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].gtot), mreq, "in draw_radiation.c" );
 	rad_pattern[idx].axrt = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].axrt, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].axrt), mreq, "in draw_radiation.c" );
 	rad_pattern[idx].tilt = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].tilt, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].tilt), mreq, "in draw_radiation.c" );
 
 	mreq = NUM_POL * sizeof(double);
 	rad_pattern[idx].max_gain = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].max_gain, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].max_gain), mreq, "in draw_radiation.c" );
 	rad_pattern[idx].min_gain = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].min_gain, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].min_gain), mreq, "in draw_radiation.c" );
 	rad_pattern[idx].max_gain_tht = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].max_gain_tht, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].max_gain_tht), mreq, "in draw_radiation.c" );
 	rad_pattern[idx].max_gain_phi = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].max_gain_phi, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].max_gain_phi), mreq, "in draw_radiation.c" );
 
 	mreq = NUM_POL * sizeof(int);
 	rad_pattern[idx].max_gain_idx = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].max_gain_idx, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].max_gain_idx), mreq, "in draw_radiation.c" );
 	rad_pattern[idx].min_gain_idx = NULL;
-	mem_alloc( (void *)&rad_pattern[idx].min_gain_idx, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].min_gain_idx), mreq, "in draw_radiation.c" );
 
 	rad_pattern[idx].sens = NULL;
 	mreq = (size_t)(nph * nth) * sizeof(int);
-	mem_alloc( (void *)&rad_pattern[idx].sens, mreq, "in draw_radiation.c" );
+	mem_alloc( (void **)&(rad_pattern[idx].sens), mreq, "in draw_radiation.c" );
   }
 
 } /* Alloc_Rdpattern_Buffers() */
@@ -1107,35 +1097,35 @@ Alloc_Nearfield_Buffers( int n1, int n2, int n3 )
   /* Allocate near field buffers */
   if( fpat.nfeh & NEAR_EFIELD )
   {
-	mem_realloc( (void *)&near_field.ex,  mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.ey,  mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.ez,  mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.fex, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.fey, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.fez, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.erx, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.ery, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.erz, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.er,  mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.ex,  mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.ey,  mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.ez,  mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.fex, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.fey, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.fez, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.erx, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.ery, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.erz, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.er,  mreq, "in draw_radiation.c" );
   }
 
   if( fpat.nfeh & NEAR_HFIELD )
   {
-	mem_realloc( (void *)&near_field.hx,  mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.hy,  mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.hz,  mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.fhx, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.fhy, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.fhz, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.hrx, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.hry, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.hrz, mreq, "in draw_radiation.c" );
-	mem_realloc( (void *)&near_field.hr,  mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.hx,  mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.hy,  mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.hz,  mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.fhx, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.fhy, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.fhz, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.hrx, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.hry, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.hrz, mreq, "in draw_radiation.c" );
+	mem_realloc( (void **)&near_field.hr,  mreq, "in draw_radiation.c" );
   }
 
-  mem_realloc( (void *)&near_field.px, mreq, "in draw_radiation.c" );
-  mem_realloc( (void *)&near_field.py, mreq, "in draw_radiation.c" );
-  mem_realloc( (void *)&near_field.pz, mreq, "in draw_radiation.c" );
+  mem_realloc( (void **)&near_field.px, mreq, "in draw_radiation.c" );
+  mem_realloc( (void **)&near_field.py, mreq, "in draw_radiation.c" );
+  mem_realloc( (void **)&near_field.pz, mreq, "in draw_radiation.c" );
 
 } /* Alloc_Nearfield_Buffers() */
 
@@ -1148,10 +1138,10 @@ Alloc_Nearfield_Buffers( int n1, int n2, int n3 )
   void
 Free_Draw_Buffers( void )
 {
-  free_ptr( (void *)&point_3d );
-  free_ptr( (void *)&red );
-  free_ptr( (void *)&grn );
-  free_ptr( (void *)&blu );
+  free_ptr( (void **)&point_3d );
+  free_ptr( (void **)&red );
+  free_ptr( (void **)&grn );
+  free_ptr( (void **)&blu );
 }
 
 /*-----------------------------------------------------------------------*/
diff --git a/src/draw_structure.c b/src/draw_structure.c
index b6a1268..72f2557 100644
--- a/src/draw_structure.c
+++ b/src/draw_structure.c
@@ -34,10 +34,6 @@
   void
 Draw_Structure( GtkWidget *drawingarea )
 {
-  /* Block motion events */
-  g_signal_handler_block
-	( (gpointer)drawingarea, structure_motion_handler );
-
   /* Abort if xnec2c may be quit by user */
   if( isFlagSet(MAIN_QUIT) )
 	return;
@@ -80,10 +76,6 @@ Draw_Structure( GtkWidget *drawingarea )
 
   cairo_destroy( cr );
 
-  /* Unblock motion events */
-  g_signal_handler_unblock(
-	  (gpointer)drawingarea, structure_motion_handler );
-
 } /* Draw_Structure() */
 
 /*-----------------------------------------------------------------------*/
@@ -161,12 +153,12 @@ New_Patch_Data( void )
 
   /* Allocate memory for patch line segments */
   mreq = (size_t)(2 * data.m) * sizeof(double);
-  mem_realloc( (void *)&data.px1, mreq, "in draw_structure.c" );
-  mem_realloc( (void *)&data.py1, mreq, "in draw_structure.c" );
-  mem_realloc( (void *)&data.pz1, mreq, "in draw_structure.c" );
-  mem_realloc( (void *)&data.px2, mreq, "in draw_structure.c" );
-  mem_realloc( (void *)&data.py2, mreq, "in draw_structure.c" );
-  mem_realloc( (void *)&data.pz2, mreq, "in draw_structure.c" );
+  mem_realloc( (void **)&data.px1, mreq, "in draw_structure.c" );
+  mem_realloc( (void **)&data.py1, mreq, "in draw_structure.c" );
+  mem_realloc( (void **)&data.pz1, mreq, "in draw_structure.c" );
+  mem_realloc( (void **)&data.px2, mreq, "in draw_structure.c" );
+  mem_realloc( (void **)&data.py2, mreq, "in draw_structure.c" );
+  mem_realloc( (void **)&data.pz2, mreq, "in draw_structure.c" );
 
   /* Find point furthest from xyz axes origin */
   r_max = 0.0;
@@ -404,6 +396,7 @@ Draw_Wire_Segments(	GdkSegment *segm, gint nseg )
 	/* To color structure segs */
 	double red = 0.0, grn = 0.0, blu = 0.0;
 	char label[11];
+	size_t s = sizeof( label );
 
 	/* Loop over all wire segs, find max current/charge */
 	if( crnt.newer )
@@ -425,9 +418,9 @@ Draw_Wire_Segments(	GdkSegment *segm, gint nseg )
 
 	  /* Show max value in color code label */
 	  if( isFlagSet(DRAW_CURRENTS) )
-		snprintf( label, 11, "%10.3E", cmax * (double)data.wlam );
+		snprintf( label, s, "%10.3E", cmax * (double)data.wlam );
 	  else
-		snprintf( label, 11, "%10.3E", cmax * 1.0E-6/(double)calc_data.fmhz );
+		snprintf( label, s, "%10.3E", cmax * 1.0E-6/(double)calc_data.fmhz );
 	  gtk_label_set_text(
 		  GTK_LABEL(lookup_widget(structure_drawingarea,
 			  "main_colorcode_maxlabel")), label );
@@ -706,7 +699,7 @@ Init_Struct_Drawing( void )
 {
   /* We need n segs for wires + 2m for patces */
   size_t mreq = (size_t)(data.n + 2*data.m) * sizeof(GdkSegment);
-  mem_realloc( (void *)&structure_segs, mreq, "in draw_structure.c" );
+  mem_realloc( (void **)&structure_segs, mreq, "in draw_structure.c" );
   New_Wire_Data();
   New_Patch_Data();
 }
@@ -730,12 +723,12 @@ Show_Viewer_Gain(
   {
 	char txt[8];
 
-	if( isFlagSet(ENABLE_RDPAT) && (calc_data.fstep >=0) )
+	if( isFlagSet(ENABLE_RDPAT) && (calc_data.fstep >= 0) )
 	{
-	  snprintf( txt, 8, "%7.2f",
+	  snprintf( txt, sizeof(txt), "%7.2f",
 		  Viewer_Gain(proj_params, calc_data.fstep) );
-	  txt[7] = '\0';
-	  gtk_entry_set_text( GTK_ENTRY(lookup_widget(window, widget)), txt );
+	  gtk_entry_set_text(
+		  GTK_ENTRY(lookup_widget(window, widget)), txt );
 	}
   }
 
diff --git a/src/fields.c b/src/fields.c
index 7cff010..2f843a5 100644
--- a/src/fields.c
+++ b/src/fields.c
@@ -76,7 +76,7 @@ void efld( double xi, double yi,
   static complex double *egnd = NULL;
 
   size_t mreq = 9 * sizeof(complex double);
-  mem_alloc( (void *)&egnd, mreq, "in fields.c");
+  mem_alloc( (void **)&egnd, mreq, "in fields.c");
 
   xij= xi- dataj.xj;
   yij= yi- dataj.yj;
@@ -324,7 +324,8 @@ void efld( double xi, double yi,
 	rh= r- zp* zp;
 	if( rh <= 1.0e-10)
 	  dmin=0.0;
-	else dmin= sqrt( rh/( rh+ ai* ai));
+	else
+	  dmin= sqrt( rh/( rh+ ai* ai));
 
 	if( dmin <= .95)
 	{
diff --git a/src/fork.c b/src/fork.c
index 9f5c79e..1399ef2 100644
--- a/src/fork.c
+++ b/src/fork.c
@@ -333,7 +333,7 @@ Pass_Freq_Data( void )
 	Write_Pipe( num_child_procs, "noeh", 4, TRUE );
 
   /* Allocate data buffers */
-  mem_alloc( (void *)&buff, buff_size, "in fork.c" );
+  mem_alloc( (void **)&buff, buff_size, "in fork.c" );
 
   /* Clear buffer index in this function */
   Mem_Copy( buff, buff, 0, WRITE );
@@ -450,7 +450,7 @@ Pass_Freq_Data( void )
   /* Pass data accumulated in buffer if child */
   Write_Pipe( num_child_procs, buff, (ssize_t)buff_size, TRUE );
 
-  free_ptr( (void *)&buff );
+  free_ptr( (void **)&buff );
 
 } /* Pass_Freq_Data() */
 
@@ -520,7 +520,7 @@ Get_Freq_Data( int idx, int fstep )
   }
 
   /* Allocate data buffer */
-  mem_alloc( (void *)&buff, buff_size, "in fork.c" );
+  mem_alloc( (void **)&buff, buff_size, "in fork.c" );
 
   /* Clear buffer index in this function */
   Mem_Copy( buff, buff, 0, READ );
@@ -633,7 +633,7 @@ Get_Freq_Data( int idx, int fstep )
 
   } /*if( isFlagSet(DRAW_EHFIELD) ) */
 
-  free_ptr( (void *)&buff );
+  free_ptr( (void **)&buff );
 
 } /* Get_Freq_Data() */
 
diff --git a/src/geom_edit.c b/src/geom_edit.c
index b7f44b8..f9d2769 100644
--- a/src/geom_edit.c
+++ b/src/geom_edit.c
@@ -1511,7 +1511,7 @@ Scale_Editor( int action )
 	Set_Geometry_Int_Data( geom_store, &iter_gs, iv );
 
 	/* Enter scale factor */
-	snprintf( sf, 13, "%12.5E", scale );
+	snprintf( sf, sizeof(sf), "%12.5E", scale );
 	gtk_list_store_set(
 		geom_store, &iter_gs, GEOM_COL_F1, sf, -1 );
 
@@ -1930,7 +1930,7 @@ Gend_Editor( int action )
 		if( gtk_toggle_button_get_active(toggle) )
 		  break;
 	  }
-	  snprintf( si, 6, "%5d", idx-1 );
+	  snprintf( si, sizeof(si), "%5d", idx-1 );
 	  save = TRUE;
 
   } /* switch( action ) */
@@ -2090,7 +2090,7 @@ Set_Geometry_Int_Data( GtkListStore *store, GtkTreeIter *iter, int *iv )
   {
 	for( idi = GEOM_COL_I1; idi <= GEOM_COL_I2; idi++ )
 	{
-	  snprintf( str, 6, "%5d", iv[idi-GEOM_COL_I1] );
+	  snprintf( str, sizeof(str), "%5d", iv[idi-GEOM_COL_I1] );
 	  gtk_list_store_set( store, iter, idi, str, -1 );
 	}
 
diff --git a/src/geometry.c b/src/geometry.c
index 2329284..60bdd07 100644
--- a/src/geometry.c
+++ b/src/geometry.c
@@ -75,17 +75,17 @@ arc( int itg, int ns, double rada,
 
 	/* Reallocate tags buffer */
 	mreq = (size_t)(data.n + data.m) * sizeof(int);
-	mem_realloc( (void *)&data.itag, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.itag, mreq, "in geometry.c" );
 
 	/* Reallocate wire buffers */
 	mreq = (size_t)data.n * sizeof(double);
-	mem_realloc( (void *)&data.x1, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.y1, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.z1, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.x2, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.y2, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.z2, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.bi, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.x1, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.y1, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.z1, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.x2, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.y2, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.z2, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.bi, mreq, "in geometry.c" );
 
 	ang= ang1* TA;
 	dang=( ang2- ang1)* TA/ ns;
@@ -168,8 +168,8 @@ conect( int ignd )
   {
 	/* Allocate memory to connections */
 	mreq = (size_t)(data.n + data.m) * sizeof(int);
-	mem_realloc( (void *)&data.icon1, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.icon2, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.icon1, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.icon2, mreq, "in geometry.c" );
 
 	for( i = 0; i < data.n; i++ )
 	{
@@ -367,7 +367,7 @@ conect( int ignd )
 
   /* Allocate to connection buffers */
   mreq = (size_t)segj.maxcon * sizeof(int);
-  mem_realloc( (void *)&segj.jco, mreq, "in geometry.c" );
+  mem_realloc( (void **)&segj.jco, mreq, "in geometry.c" );
 
   /* Adjust connected segment ends to exactly coincide.
    * Also find old seg. connecting to new segment */
@@ -412,7 +412,7 @@ conect( int ignd )
 		  {
 			segj.maxcon = ic+1;
 			mreq = (size_t)segj.maxcon * sizeof(int);
-			mem_realloc( (void *)&segj.jco, mreq, "in geometry.c" );
+			mem_realloc( (void **)&segj.jco, mreq, "in geometry.c" );
 		  }
 		  segj.jco[ic-1]= ix* jend;
 
@@ -494,9 +494,9 @@ conect( int ignd )
   } /* for( j = 0; j < data.n; j++ ) */
 
   mreq = (size_t)segj.maxcon * sizeof(double);
-  mem_realloc( (void *)&segj.ax, mreq, "in geometry.c" );
-  mem_realloc( (void *)&segj.bx, mreq, "in geometry.c" );
-  mem_realloc( (void *)&segj.cx, mreq, "in geometry.c" );
+  mem_realloc( (void **)&segj.ax, mreq, "in geometry.c" );
+  mem_realloc( (void **)&segj.bx, mreq, "in geometry.c" );
+  mem_realloc( (void **)&segj.cx, mreq, "in geometry.c" );
 
   return( TRUE );
 }
@@ -528,17 +528,17 @@ helix(
 
   /* Reallocate tags buffer */
   mreq = (size_t)data.n * sizeof(int);
-  mem_realloc( (void *)&data.itag, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.itag, mreq, "in geometry.c" );
 
   /* Reallocate wire buffers */
   mreq = (size_t)data.n * sizeof(double);
-  mem_realloc( (void *)&data.x1, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.y1, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.z1, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.x2, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.y2, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.z2, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.bi, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.x1, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.y1, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.z1, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.x2, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.y2, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.z2, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.bi, mreq, "in geometry.c" );
 
   data.z1[ist] = 0.0;
   for( i = ist; i < data.n; i++ )
@@ -699,17 +699,17 @@ move( double rox, double roy,
 	  k= data.n;
 	  /* Reallocate tags buffer */
 	  mreq = (size_t)(data.n + data.m + (data.n + 1 - i1) * nrpt) * sizeof(int);
-	  mem_realloc( (void *)&data.itag, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.itag, mreq, "in geometry.c" );
 
 	  /* Reallocate wire buffers */
 	  mreq = (size_t)(data.n + (data.n + 1 - i1) * nrpt) * sizeof(double);
-	  mem_realloc( (void *)&data.x1, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.y1, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.z1, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.x2, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.y2, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.z2, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.bi, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.x1, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.y1, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.z1, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.x2, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.y2, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.z2, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.bi, mreq, "in geometry.c" );
 	}
 
 	for( ir = 0; ir < nrp; ir++ )
@@ -753,17 +753,17 @@ move( double rox, double roy,
 
 	/* Reallocate patch buffers */
 	mreq = (size_t)(data.m * (nrpt + 1)) * sizeof(double);
-	mem_realloc( (void *)&data.px,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.py,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.pz,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1x, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1y, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1z, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2x, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2y, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2z, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.pbi, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.psalp, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.px,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.py,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.pz,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1x, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1y, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1z, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2x, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2y, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2z, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.pbi, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.psalp, mreq, "in geometry.c" );
 
 	for( ii = 0; ii < nrp; ii++ )
 	{
@@ -838,17 +838,17 @@ patch(
 
   /* Reallocate patch buffers */
   mreq = (size_t)data.m * sizeof(double);
-  mem_realloc( (void *)&data.px,  mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.py,  mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.pz,  mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1x, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1y, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1z, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t2x, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t2y, mreq, "in geometry.c");
-  mem_realloc( (void *)&data.t2z, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.pbi, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.psalp, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.px,  mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.py,  mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.pz,  mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1x, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1y, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1z, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t2x, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t2y, mreq, "in geometry.c");
+  mem_realloc( (void **)&data.t2z, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.pbi, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.psalp, mreq, "in geometry.c" );
 
   if( nx > 0) ntp=2;
   else ntp= ny;
@@ -977,17 +977,17 @@ patch(
 	data.m += nx*ny-1;
 	/* Reallocate patch buffers */
 	mreq = (size_t)data.m * sizeof(double);
-	mem_realloc( (void *)&data.px,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.py,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.pz,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1x, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1y, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1z, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2x, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2y, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2z, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.pbi, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.psalp, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.px,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.py,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.pz,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1x, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1y, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1z, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2x, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2y, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2z, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.pbi, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.psalp, mreq, "in geometry.c" );
 
 	xn2= data.px[mi]- s1x- s2x;
 	yn2= data.py[mi]- s1y- s2y;
@@ -1049,21 +1049,21 @@ subph( int nx, int ny )
   else data.m += 4;
 
   mreq = (size_t)data.m * sizeof(double);
-  mem_realloc( (void *)&data.px,  mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.py,  mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.pz,  mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1x, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1y, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1z, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t2x, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t2y, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t2z, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.pbi, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.psalp, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.px,  mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.py,  mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.pz,  mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1x, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1y, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1z, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t2x, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t2y, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t2z, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.pbi, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.psalp, mreq, "in geometry.c" );
   if( !CHILD )
   {
 	mreq = (size_t)(data.n + 2 * data.m) * sizeof(GdkSegment);
-	mem_realloc( (void *)&structure_segs, mreq, "in geometry.c" );
+	mem_realloc( (void **)&structure_segs, mreq, "in geometry.c" );
   }
 
   /* Shift patches to make room for new ones */
@@ -1178,17 +1178,17 @@ reflc( int ix, int iy, int iz, int iti, int nop )
 	  {
 		/* Reallocate tags buffer */
 		mreq = (size_t)(2 * data.n + data.m) * sizeof(int);
-		mem_realloc( (void *)&data.itag, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.itag, mreq, "in geometry.c" );
 
 		/* Reallocate wire buffers */
 		mreq = (size_t)(2 * data.n) * sizeof(double);
-		mem_realloc( (void *)&data.x1, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.y1, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.z1, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.x2, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.y2, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.z2, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.bi, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.x1, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.y1, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.z1, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.x2, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.y2, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.z2, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.bi, mreq, "in geometry.c" );
 
 		for( i = 0; i < data.n; i++ )
 		{
@@ -1232,17 +1232,17 @@ reflc( int ix, int iy, int iz, int iti, int nop )
 	  {
 		/* Reallocate patch buffers */
 		mreq = (size_t)(2 * data.m) * sizeof(double);
-		mem_realloc( (void *)&data.px,  mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.py,  mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.pz,  mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t1x, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t1y, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t1z, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t2x, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t2y, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t2z, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.pbi, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.psalp, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.px,  mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.py,  mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.pz,  mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t1x, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t1y, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t1z, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t2x, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t2y, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t2z, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.pbi, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.psalp, mreq, "in geometry.c" );
 
 		for( i = 0; i < data.m; i++ )
 		{
@@ -1283,16 +1283,16 @@ reflc( int ix, int iy, int iz, int iti, int nop )
 	  {
 		/* Reallocate tags buffer */
 		mreq = (size_t)(2 * data.n) * sizeof(int);
-		mem_realloc( (void *)&data.itag, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.itag, mreq, "in geometry.c" );
 		/* Reallocate wire buffers */
 		mreq = (size_t)(2 * data.n) * sizeof(double);
-		mem_realloc( (void *)&data.x1, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.y1, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.z1, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.x2, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.y2, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.z2, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.bi, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.x1, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.y1, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.z1, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.x2, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.y2, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.z2, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.bi, mreq, "in geometry.c" );
 
 		for( i = 0; i < data.n; i++ )
 		{
@@ -1336,17 +1336,17 @@ reflc( int ix, int iy, int iz, int iti, int nop )
 	  {
 		/* Reallocate patch buffers */
 		mreq = (size_t)(2 * data.m) * sizeof(double);
-		mem_realloc( (void *)&data.px,  mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.py,  mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.pz,  mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t1x, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t1y, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t1z, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t2x, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t2y, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.t2z, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.pbi, mreq, "in geometry.c" );
-		mem_realloc( (void *)&data.psalp, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.px,  mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.py,  mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.pz,  mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t1x, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t1y, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t1z, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t2x, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t2y, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.t2z, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.pbi, mreq, "in geometry.c" );
+		mem_realloc( (void **)&data.psalp, mreq, "in geometry.c" );
 
 		for( i = 0; i < data.m; i++ )
 		{
@@ -1388,17 +1388,17 @@ reflc( int ix, int iy, int iz, int iti, int nop )
 	{
 	  /* Reallocate tags buffer */
 	  mreq = (size_t)(2 * data.n) * sizeof(int);
-	  mem_realloc( (void *)&data.itag, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.itag, mreq, "in geometry.c" );
 
 	  /* Reallocate wire buffers */
 	  mreq = (size_t)(2 * data.n) * sizeof(double);
-	  mem_realloc( (void *)&data.x1, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.y1, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.z1, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.x2, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.y2, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.z2, mreq, "in geometry.c" );
-	  mem_realloc( (void *)&data.bi, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.x1, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.y1, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.z1, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.x2, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.y2, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.z2, mreq, "in geometry.c" );
+	  mem_realloc( (void **)&data.bi, mreq, "in geometry.c" );
 
 	  for( i = 0; i < data.n; i++ )
 	  {
@@ -1440,17 +1440,17 @@ reflc( int ix, int iy, int iz, int iti, int nop )
 
 	/* Reallocate patch buffers */
 	mreq = (size_t)(2 * data.m) * sizeof(double);
-	mem_realloc( (void *)&data.px,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.py,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.pz,  mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1x, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1y, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t1z, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2x, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2y, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.t2z, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.pbi, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.psalp, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.px,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.py,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.pz,  mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1x, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1y, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t1z, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2x, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2y, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.t2z, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.pbi, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.psalp, mreq, "in geometry.c" );
 
 	for( i = 0; i < data.m; i++ )
 	{
@@ -1497,17 +1497,17 @@ reflc( int ix, int iy, int iz, int iti, int nop )
 
 	/* Reallocate tags buffer */
 	mreq = (size_t)data.n * sizeof(int);
-	mem_realloc( (void *)&data.itag, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.itag, mreq, "in geometry.c" );
 
 	/* Reallocate wire buffers */
 	mreq = (size_t)data.n * sizeof(double);
-	mem_realloc( (void *)&data.x1, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.y1, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.z1, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.x2, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.y2, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.z2, mreq, "in geometry.c" );
-	mem_realloc( (void *)&data.bi, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.x1, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.y1, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.z1, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.x2, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.y2, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.z2, mreq, "in geometry.c" );
+	mem_realloc( (void **)&data.bi, mreq, "in geometry.c" );
 
 	for( i = nx; i < data.n; i++ )
 	{
@@ -1540,17 +1540,17 @@ reflc( int ix, int iy, int iz, int iti, int nop )
 
   /* Reallocate patch buffers */
   mreq = (size_t)data.m * sizeof(double);
-  mem_realloc( (void *)&data.px,  mreq, "in geometry.c"  );
-  mem_realloc( (void *)&data.py,  mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.pz,  mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1x, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1y, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t1z, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t2x, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t2y, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.t2z, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.pbi, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.psalp, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.px,  mreq, "in geometry.c"  );
+  mem_realloc( (void **)&data.py,  mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.pz,  mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1x, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1y, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t1z, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t2x, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t2y, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.t2z, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.pbi, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.psalp, mreq, "in geometry.c" );
 
   for( i = nx; i < data.m; i++ )
   {
@@ -1602,17 +1602,17 @@ wire( double xw1, double yw1, double zw1,
 
   /* Reallocate tags buffer */
   mreq = (size_t)data.n * sizeof(int);
-  mem_realloc( (void *)&data.itag, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.itag, mreq, "in geometry.c" );
 
   /* Reallocate wire buffers */
   mreq = (size_t)data.n * sizeof(double);
-  mem_realloc( (void *)&data.x1, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.y1, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.z1, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.x2, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.y2, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.z2, mreq, "in geometry.c" );
-  mem_realloc( (void *)&data.bi, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.x1, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.y1, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.z1, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.x2, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.y2, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.z2, mreq, "in geometry.c" );
+  mem_realloc( (void **)&data.bi, mreq, "in geometry.c" );
 
   xd= xw2- xw1;
   yd= yw2- yw1;
diff --git a/src/gnuplot.c b/src/gnuplot.c
index 9372e52..f060ca7 100644
--- a/src/gnuplot.c
+++ b/src/gnuplot.c
@@ -79,7 +79,7 @@ Save_FreqPlots_Gnuplot_Data( char *filename )
 
 	  /* Max gain for given polarization type */
 	  gmax = rad_pattern[idx].gtot[mgidx] +
-		10.0 * log10( Polarization_Factor(pol, idx, mgidx) );
+		Polarization_Factor(pol, idx, mgidx);
 
 	  /* Net gain if selected */
 	  if( isFlagSet(PLOT_NETGAIN) )
@@ -127,8 +127,8 @@ Save_FreqPlots_Gnuplot_Data( char *filename )
 	  /* Front to back ratio */
 	  fbratio  = pow( 10.0, gmax / 10.0 );
 	  fbratio /= pow( 10.0,
-		  rad_pattern[idx].gtot[fbidx] / 10.0 +
-		  log10(Polarization_Factor(pol, idx, fbidx)) );
+		  (rad_pattern[idx].gtot[fbidx] +
+		   Polarization_Factor(pol, idx, fbidx)) / 10.0 );
 	  fbratio = 10.0 * log10( fbratio );
 
 	  if( no_fbr && isFlagClear(PLOT_NETGAIN) ) /* Plot max gain only */
@@ -313,10 +313,10 @@ Save_RadPattern_Gnuplot_Data( char *filename )
 	  if( mreq != (size_t)npts * sizeof( double ) )
 	  {
 		mreq = (size_t)npts * sizeof( double );
-		mem_realloc( (void *)&pov_x, mreq, "in draw_radiation.c" );
-		mem_realloc( (void *)&pov_y, mreq, "in draw_radiation.c" );
-		mem_realloc( (void *)&pov_z, mreq, "in draw_radiation.c" );
-		mem_realloc( (void *)&pov_r, mreq, "in draw_radiation.c" );
+		mem_realloc( (void **)&pov_x, mreq, "in draw_radiation.c" );
+		mem_realloc( (void **)&pov_y, mreq, "in draw_radiation.c" );
+		mem_realloc( (void **)&pov_z, mreq, "in draw_radiation.c" );
+		mem_realloc( (void **)&pov_r, mreq, "in draw_radiation.c" );
 	  }
 
 	  /* Calculate Poynting vector and its max and min */
diff --git a/src/ground.c b/src/ground.c
index c2d583f..0f5aa45 100644
--- a/src/ground.c
+++ b/src/ground.c
@@ -70,14 +70,14 @@ rom2( double a, double b,
   {
 	first_call = FALSE;
 	size_t mreq = 9 * sizeof(complex double);
-	mem_alloc( (void *)&g1, mreq, "in ground.c");
-	mem_alloc( (void *)&g2, mreq, "in ground.c");
-	mem_alloc( (void *)&g3, mreq, "in ground.c");
-	mem_alloc( (void *)&g4, mreq, "in ground.c");
-	mem_alloc( (void *)&g5, mreq, "in ground.c");
-	mem_alloc( (void *)&t01, mreq, "in ground.c");
-	mem_alloc( (void *)&t10, mreq, "in ground.c");
-	mem_alloc( (void *)&t20, mreq, "in ground.c");
+	mem_alloc( (void **)&g1, mreq, "in ground.c");
+	mem_alloc( (void **)&g2, mreq, "in ground.c");
+	mem_alloc( (void **)&g3, mreq, "in ground.c");
+	mem_alloc( (void **)&g4, mreq, "in ground.c");
+	mem_alloc( (void **)&g5, mreq, "in ground.c");
+	mem_alloc( (void **)&t01, mreq, "in ground.c");
+	mem_alloc( (void **)&t10, mreq, "in ground.c");
+	mem_alloc( (void **)&t20, mreq, "in ground.c");
   }
 
   z= a;
diff --git a/src/input.c b/src/input.c
index b591958..f3dc8e5 100644
--- a/src/input.c
+++ b/src/input.c
@@ -81,7 +81,7 @@ Read_Comments( void )
 	}
 
 	/* separate card's id mnemonic */
-	Strlcpy( ain, line_buf, 3 );
+	Strlcpy( ain, line_buf, sizeof(ain) );
 
 	/* Check for incorrect mnemonic */
 	if( (strcmp(ain, "CM") != 0) && (strcmp(ain, "CE") != 0) )
@@ -116,34 +116,34 @@ Read_Geometry( void )
 
   /* Memory allocation for temporary buffers */
   mreq = (size_t)data.npm * sizeof(double);
-  mem_realloc( (void *)&save.xtemp,  mreq, "in input.c" );
-  mem_realloc( (void *)&save.ytemp,  mreq, "in input.c" );
-  mem_realloc( (void *)&save.ztemp,  mreq, "in input.c" );
-  mem_realloc( (void *)&save.bitemp, mreq, "in input.c" );
+  mem_realloc( (void **)&save.xtemp,  mreq, "in input.c" );
+  mem_realloc( (void **)&save.ytemp,  mreq, "in input.c" );
+  mem_realloc( (void **)&save.ztemp,  mreq, "in input.c" );
+  mem_realloc( (void **)&save.bitemp, mreq, "in input.c" );
   if( data.n > 0 )
   {
 	mreq = (size_t)data.n * sizeof(double);
-	mem_realloc( (void *)&save.sitemp, mreq, "in input.c" );
+	mem_realloc( (void **)&save.sitemp, mreq, "in input.c" );
   }
 
   /* Memory allocation for primary interacton matrix. */
   mreq = (size_t)(data.np2m * (data.np + 2 * data.mp)) * sizeof(complex double);
-  mem_realloc( (void *)&cm, mreq, "in input.c" );
+  mem_realloc( (void **)&cm, mreq, "in input.c" );
 
   /* Memory allocation for current buffers */
   mreq = (size_t)data.npm * sizeof( double);
-  mem_realloc( (void *)&crnt.air, mreq, "in input.c" );
-  mem_realloc( (void *)&crnt.aii, mreq, "in input.c" );
-  mem_realloc( (void *)&crnt.bir, mreq, "in input.c" );
-  mem_realloc( (void *)&crnt.bii, mreq, "in input.c" );
-  mem_realloc( (void *)&crnt.cir, mreq, "in input.c" );
-  mem_realloc( (void *)&crnt.cii, mreq, "in input.c" );
+  mem_realloc( (void **)&crnt.air, mreq, "in input.c" );
+  mem_realloc( (void **)&crnt.aii, mreq, "in input.c" );
+  mem_realloc( (void **)&crnt.bir, mreq, "in input.c" );
+  mem_realloc( (void **)&crnt.bii, mreq, "in input.c" );
+  mem_realloc( (void **)&crnt.cir, mreq, "in input.c" );
+  mem_realloc( (void **)&crnt.cii, mreq, "in input.c" );
   mreq = (size_t)data.np3m * sizeof( complex double);
-  mem_realloc( (void *)&crnt.cur, mreq, "in input.c" );
+  mem_realloc( (void **)&crnt.cur, mreq, "in input.c" );
 
   /* Memory allocation for loading buffers */
   mreq = (size_t)data.npm * sizeof(complex double);
-  mem_realloc( (void *)&zload.zarray, mreq, "in input.c" );
+  mem_realloc( (void **)&zload.zarray, mreq, "in input.c" );
 
   /* Save segment and patch data for freq scaling */
   if( data.n > 0 )
@@ -194,7 +194,7 @@ Read_Commands( void )
   double tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
   int
 	mpcnt, itmp1, itmp2, itmp3, itmp4,
-	ain_num;     /* My addition, ain mnemonic as a number */
+	ain_num;   /* My addition, ain mnemonic as a number */
   size_t mreq; /* My addition, size req. for malloc's   */
 
   /* initializations etc from original fortran code */
@@ -243,12 +243,12 @@ Read_Commands( void )
 
   /* Allocate some buffers */
   mreq = (size_t)data.np2m * sizeof(int);
-  mem_realloc( (void *)&save.ip, mreq, "in input.c" );
+  mem_realloc( (void **)&save.ip, mreq, "in input.c" );
 
   /* Memory allocation for symmetry array */
   smat.nop = netcx.neq/netcx.npeq;
   mreq = (size_t)(smat.nop * smat.nop) * sizeof( complex double);
-  mem_realloc( (void *)&smat.ssx, mreq, "in input.c" );
+  mem_realloc( (void **)&smat.ssx, mreq, "in input.c" );
 
   /* main input section, exits at various points */
   /* depending on error conditions or end of job */
@@ -307,11 +307,11 @@ Read_Commands( void )
 		  {
 			vsorc.nvqd++;
 			mreq = (size_t)vsorc.nvqd * sizeof(int);
-			mem_realloc( (void *)&vsorc.ivqd, mreq, "in input.c" );
-			mem_realloc( (void *)&vsorc.iqds, mreq, "in input.c" );
+			mem_realloc( (void **)&vsorc.ivqd, mreq, "in input.c" );
+			mem_realloc( (void **)&vsorc.iqds, mreq, "in input.c" );
 			mreq = (size_t)vsorc.nvqd * sizeof(complex double);
-			mem_realloc( (void *)&vsorc.vqd, mreq, "in input.c" );
-			mem_realloc( (void *)&vsorc.vqds, mreq, "in input.c" );
+			mem_realloc( (void **)&vsorc.vqd, mreq, "in input.c" );
+			mem_realloc( (void **)&vsorc.vqds, mreq, "in input.c" );
 			{
 			  int indx = vsorc.nvqd-1;
 
@@ -331,9 +331,9 @@ Read_Commands( void )
 			/* Else, applied E field */
 			vsorc.nsant++;
 			mreq = (size_t)vsorc.nsant * sizeof(int);
-			mem_realloc( (void *)&vsorc.isant, mreq, "in input.c" );
+			mem_realloc( (void **)&vsorc.isant, mreq, "in input.c" );
 			mreq = (size_t)vsorc.nsant * sizeof(complex double);
-			mem_realloc( (void *)&vsorc.vsant, mreq, "in input.c" );
+			mem_realloc( (void **)&vsorc.vsant, mreq, "in input.c" );
 			{
 			  int indx = vsorc.nsant-1;
 
@@ -384,13 +384,13 @@ Read_Commands( void )
 		/* Allocate normalization buffer */
 		{
 		  mreq = (size_t)calc_data.nfrq * sizeof(double);
-		  mem_realloc( (void *)&impedance_data.zreal, mreq, "in input.c" );
-		  mem_realloc( (void *)&impedance_data.zimag, mreq, "in input.c" );
-		  mem_realloc( (void *)&impedance_data.zmagn, mreq, "in input.c" );
-		  mem_realloc( (void *)&impedance_data.zphase, mreq, "in input.c" );
-		  mem_realloc( (void *)&save.freq, mreq, "in input.c" );
+		  mem_realloc( (void **)&impedance_data.zreal, mreq, "in input.c" );
+		  mem_realloc( (void **)&impedance_data.zimag, mreq, "in input.c" );
+		  mem_realloc( (void **)&impedance_data.zmagn, mreq, "in input.c" );
+		  mem_realloc( (void **)&impedance_data.zphase, mreq, "in input.c" );
+		  mem_realloc( (void **)&save.freq, mreq, "in input.c" );
 		  mreq = (size_t)calc_data.nfrq * sizeof(char);
-		  mem_realloc( (void *)&save.fstep, mreq, "in input.c" );
+		  mem_realloc( (void **)&save.fstep, mreq, "in input.c" );
 		}
 
 		if( CHILD ) continue;
@@ -498,15 +498,15 @@ Read_Commands( void )
 		  /* Reallocate loading buffers */
 		  zload.nload++;
 		  mreq = (size_t)zload.nload * sizeof(int);
-		  mem_realloc( (void *)&calc_data.ldtyp,  mreq, "in input.c" );
-		  mem_realloc( (void *)&calc_data.ldtag,  mreq, "in input.c" );
-		  mem_realloc( (void *)&calc_data.ldtagf, mreq, "in input.c" );
-		  mem_realloc( (void *)&calc_data.ldtagt, mreq, "in input.c" );
+		  mem_realloc( (void **)&calc_data.ldtyp,  mreq, "in input.c" );
+		  mem_realloc( (void **)&calc_data.ldtag,  mreq, "in input.c" );
+		  mem_realloc( (void **)&calc_data.ldtagf, mreq, "in input.c" );
+		  mem_realloc( (void **)&calc_data.ldtagt, mreq, "in input.c" );
 
 		  mreq = (size_t)zload.nload * sizeof(double);
-		  mem_realloc( (void *)&calc_data.zlr, mreq, "in input.c" );
-		  mem_realloc( (void *)&calc_data.zli, mreq, "in input.c" );
-		  mem_realloc( (void *)&calc_data.zlc, mreq, "in input.c" );
+		  mem_realloc( (void **)&calc_data.zlr, mreq, "in input.c" );
+		  mem_realloc( (void **)&calc_data.zli, mreq, "in input.c" );
+		  mem_realloc( (void **)&calc_data.zlc, mreq, "in input.c" );
 
 		  idx = zload.nload-1;
 		  calc_data.ldtyp[idx]= itmp1;
@@ -540,8 +540,8 @@ Read_Commands( void )
 			{
 			  nseg = data.n;
 			  mreq = (size_t)(nseg + zload.nldseg) * sizeof(int);
-			  mem_realloc( (void *)&zload.ldsegn, mreq, "in input.c" );
-			  mem_realloc( (void *)&zload.ldtype, mreq, "in input.c" );
+			  mem_realloc( (void **)&zload.ldsegn, mreq, "in input.c" );
+			  mem_realloc( (void **)&zload.ldtype, mreq, "in input.c" );
 			  for( idx = 0; idx < nseg; idx++ )
 			  {
 				zload.ldtype[zload.nldseg]   = itmp1;
@@ -553,8 +553,8 @@ Read_Commands( void )
 			  nseg = itmp4 - itmp3 + 1;
 			  if( nseg <= 0 ) nseg = 1;
 			  mreq = (size_t)(nseg + zload.nldseg) * sizeof(int);
-			  mem_realloc( (void *)&zload.ldsegn, mreq, "in input.c" );
-			  mem_realloc( (void *)&zload.ldtype, mreq, "in input.c" );
+			  mem_realloc( (void **)&zload.ldsegn, mreq, "in input.c" );
+			  mem_realloc( (void **)&zload.ldtype, mreq, "in input.c" );
 			  for( idx = 0; idx < nseg; idx++ )
 			  {
 				zload.ldtype[zload.nldseg]   = itmp1;
@@ -571,8 +571,8 @@ Read_Commands( void )
 				if( data.itag[idx] == itmp2 )
 				{
 				  mreq = (size_t)(zload.nldseg + 1) * sizeof(int);
-				  mem_realloc( (void *)&zload.ldsegn, mreq, "in input.c" );
-				  mem_realloc( (void *)&zload.ldtype, mreq, "in input.c" );
+				  mem_realloc( (void **)&zload.ldsegn, mreq, "in input.c" );
+				  mem_realloc( (void **)&zload.ldtype, mreq, "in input.c" );
 				  zload.ldtype[zload.nldseg]   = itmp1;
 				  zload.ldsegn[zload.nldseg++] = idx+1;
 				}
@@ -582,8 +582,8 @@ Read_Commands( void )
 			  nseg = itmp4 - itmp3 + 1;
 			  if( nseg <= 0 ) nseg = 1; /* Just one seg of tag (=itmp3) */
 			  mreq = (size_t)(zload.nldseg + nseg) * sizeof(int);
-			  mem_realloc( (void *)&zload.ldsegn, mreq, "in input.c" );
-			  mem_realloc( (void *)&zload.ldtype, mreq, "in input.c" );
+			  mem_realloc( (void **)&zload.ldsegn, mreq, "in input.c" );
+			  mem_realloc( (void **)&zload.ldtype, mreq, "in input.c" );
 			  for( idx = 0; idx < nseg; idx++ )
 			  {
 				zload.ldtype[zload.nldseg] = itmp1;
@@ -634,17 +634,17 @@ Read_Commands( void )
 		  /* Re-allocate network buffers */
 		  netcx.nonet++;
 		  mreq = (size_t)netcx.nonet * sizeof(int);
-		  mem_realloc( (void *)&netcx.ntyp,  mreq, "in input.c" );
-		  mem_realloc( (void *)&netcx.iseg1, mreq, "in input.c" );
-		  mem_realloc( (void *)&netcx.iseg2, mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.ntyp,  mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.iseg1, mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.iseg2, mreq, "in input.c" );
 
 		  mreq = (size_t)netcx.nonet * sizeof(double);
-		  mem_realloc( (void *)&netcx.x11r, mreq, "in input.c" );
-		  mem_realloc( (void *)&netcx.x11i, mreq, "in input.c" );
-		  mem_realloc( (void *)&netcx.x12r, mreq, "in input.c" );
-		  mem_realloc( (void *)&netcx.x12i, mreq, "in input.c" );
-		  mem_realloc( (void *)&netcx.x22r, mreq, "in input.c" );
-		  mem_realloc( (void *)&netcx.x22i, mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.x11r, mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.x11i, mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.x12r, mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.x12i, mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.x22r, mreq, "in input.c" );
+		  mem_realloc( (void **)&netcx.x22i, mreq, "in input.c" );
 
 		  idx = netcx.nonet-1;
 		  if( ain_num == 12 )
@@ -734,11 +734,6 @@ Read_Commands( void )
 		}
 		if( fpat.iax != 0) fpat.iax = 1;
 		if( fpat.ipd != 0) fpat.ipd = 1;
-		if( (fpat.nth < 2) || (fpat.nph < 1) || (gnd.ifar == 1) )
-		  ClearFlag( ENABLE_RDPAT );
-		else
-		  SetFlag( ENABLE_RDPAT );
-
 		fpat.thets = tmp1;
 		fpat.phis  = tmp2;
 		fpat.dth   = tmp3;
@@ -811,9 +806,15 @@ Read_Commands( void )
 		return( FALSE );
 	} /* switch( ain_num ) */
 
-	/* Allocate radiation pattern buffers */
-	if( isFlagSet(ENABLE_RDPAT) )
+	/* Disable radiation pattern plots */
+	if( (fpat.nth < 2) || (fpat.nph < 1) || (gnd.ifar == 1) )
+	  ClearFlag( ENABLE_RDPAT );
+	else
+	{
+	  /* Allocate radiation pattern buffers */
 	  Alloc_Rdpattern_Buffers( calc_data.nfrq+1, fpat.nth, fpat.nph );
+	  SetFlag( ENABLE_RDPAT );
+	}
 
 	return( TRUE );
   } /* while( TRUE ) */
@@ -843,20 +844,20 @@ readmn( char *mn, int *i1, int *i2, int *i3, int *i4,
   *f1 = *f2 = *f3 = *f4 = *f5 = *f6 = 0.0;
 
   /* read a line from input file */
-  mem_alloc((void *)&line_buf, LINE_LEN, "in readgm()");
+  mem_alloc((void **)&line_buf, LINE_LEN, "in readmn()");
   if( line_buf == NULL ) return( FALSE );
   startptr = line_buf;
   eof = Load_Line( line_buf, input_fp );
   if( eof == EOF )
   {
-	Strlcpy( mn, "EN", strlen("EN")+1 );
+	Strlcpy( mn, "EN", 3 );
 	fprintf( stderr,
 		"xnec2c: readmn(): command data card error\n"
 		"Unexpected EOF while reading input file - appending EN card\n" );
 	stop( _("readmn(): Command data card error\n"\
 		  "Unexpected EOF while reading input file\n"\
 			"Uppending a default EN card"), ERR_OK );
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( FALSE );
   }
 
@@ -866,13 +867,13 @@ readmn( char *mn, int *i1, int *i2, int *i3, int *i4,
   /* abort if card's mnemonic too short or missing */
   if( len < 2 )
   {
-	Strlcpy( mn, "XX", strlen("XX")+1 );
+	Strlcpy( mn, "XX", 3 );
 	fprintf( stderr,
 		"xnec2c: readmn(): command data card error\n"
 		"card's mnemonic code too short or missing\n" );
 	stop( _("readmn(): Command data card error\n"\
 		  "Mnemonic code too short or missing"), ERR_OK );
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( FALSE );
   }
 
@@ -882,14 +883,14 @@ readmn( char *mn, int *i1, int *i2, int *i3, int *i4,
   /* Return if only mnemonic on card */
   if( len == 2 )
   {
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( TRUE );
   }
 
   /* Compatibility with NEC4, comments between data cards */
   if( strncmp(mn, "CM", 2) == 0 )
   {
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( TRUE );
   }
 
@@ -919,7 +920,7 @@ readmn( char *mn, int *i1, int *i2, int *i3, int *i4,
 		mn, line_buf[idx], idx+1 );
 	stop( _("readmn(): Command data card error\n"\
 		  "Spurious character in command card"), ERR_OK );
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( FALSE );
   }
 
@@ -946,7 +947,7 @@ readmn( char *mn, int *i1, int *i2, int *i3, int *i4,
 	*f4= rarr[3];
 	*f5= rarr[4];
 	*f6= rarr[5];
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( TRUE );
   }
 
@@ -971,7 +972,7 @@ readmn( char *mn, int *i1, int *i2, int *i3, int *i4,
   *f5= rarr[4];
   *f6= rarr[5];
 
-  free_ptr( (void *)&startptr );
+  free_ptr( (void **)&startptr );
   return( TRUE );
 } /* readmn() */
 
@@ -998,20 +999,20 @@ readgm( char *gm, int *i1, int *i2, double *x1,
   *x1 = *y1 = *z1 = *x2 = *y2 = *z2 = *rad = 0.0;
 
   /* read a line from input file */
-  mem_alloc((void *)&line_buf, LINE_LEN, "in readgm()");
+  mem_alloc((void **)&line_buf, LINE_LEN, "in readgm()");
   if( line_buf == NULL ) return( FALSE );
   startptr = line_buf;
   eof = Load_Line( line_buf, input_fp );
   if( eof == EOF )
   {
-	Strlcpy( gm, "GE", strlen("GE")+1 );
+	Strlcpy( gm, "GE", 3 );
 	fprintf( stderr,
 		"xnec2c: readgm(): geometry data card error\n"
 		"Unexpected EOF while reading input file - appending GE card\n" );
 	stop( _("readgm(): Geometry data card error\n"\
 		  "Unexpected EOF while reading input file\n"\
 		  "Uppending a default GE card"), ERR_OK );
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( FALSE );
   }
 
@@ -1021,13 +1022,13 @@ readgm( char *gm, int *i1, int *i2, double *x1,
   /* abort if card's mnemonic too short or missing */
   if( len < 2 )
   {
-	Strlcpy( gm, "XX", strlen("XX")+1 );
+	Strlcpy( gm, "XX", 3 );
 	fprintf( stderr,
 		"xnec2c: readgm(): geometry data card error\n"
 		"card's mnemonic code too short or missing\n" );
 	stop( _("readgm(): Geometry data card error\n"\
 		  "Card's mnemonic code too short or missing"), ERR_OK );
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( FALSE );
   }
 
@@ -1037,7 +1038,7 @@ readgm( char *gm, int *i1, int *i2, double *x1,
   /* Return if only mnemonic on card */
   if( len == 2 )
   {
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( TRUE );
   }
 
@@ -1045,7 +1046,7 @@ readgm( char *gm, int *i1, int *i2, double *x1,
    * comments between data cards */
   if( strcmp(gm, "CM") == 0 )
   {
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( TRUE );
   }
 
@@ -1075,7 +1076,7 @@ readgm( char *gm, int *i1, int *i2, double *x1,
 		gm, line_buf[idx], idx+1 );
 	stop( _("readmn(): Geometry data card error\n"\
 		  "Spurious character in command card"), ERR_OK );
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( FALSE );
   }
 
@@ -1101,7 +1102,7 @@ readgm( char *gm, int *i1, int *i2, double *x1,
 	*y2 = rarr[4];
 	*z2 = rarr[5];
 	*rad= rarr[6];
-	free_ptr( (void *)&startptr );
+	free_ptr( (void **)&startptr );
 	return( TRUE );
   }
 
@@ -1125,7 +1126,7 @@ readgm( char *gm, int *i1, int *i2, double *x1,
   *z2  = rarr[5];
   *rad = rarr[6];
 
-  free_ptr( (void *)&startptr );
+  free_ptr( (void **)&startptr );
   return( TRUE );
 } /* readgm() */
 
@@ -1309,13 +1310,13 @@ datagn( void )
 		{
 		  /* Allocate wire buffers */
 		  mreq = (size_t)data.n * sizeof(double);
-		  mem_realloc( (void *)&data.si,   mreq, "in input.c" );
-		  mem_realloc( (void *)&data.sab,  mreq, "in input.c" );
-		  mem_realloc( (void *)&data.cab,  mreq, "in input.c" );
-		  mem_realloc( (void *)&data.salp, mreq, "in input.c" );
-		  mem_realloc( (void *)&data.x, mreq, "in input.c" );
-		  mem_realloc( (void *)&data.y, mreq, "in input.c" );
-		  mem_realloc( (void *)&data.z, mreq, "in input.c" );
+		  mem_realloc( (void **)&data.si,   mreq, "in input.c" );
+		  mem_realloc( (void **)&data.sab,  mreq, "in input.c" );
+		  mem_realloc( (void **)&data.cab,  mreq, "in input.c" );
+		  mem_realloc( (void **)&data.salp, mreq, "in input.c" );
+		  mem_realloc( (void **)&data.x, mreq, "in input.c" );
+		  mem_realloc( (void **)&data.y, mreq, "in input.c" );
+		  mem_realloc( (void **)&data.z, mreq, "in input.c" );
 
 		  for( i = 0; i < data.n; i++ )
 		  {
@@ -1327,20 +1328,20 @@ datagn( void )
 			data.z[i]=( data.z1[i]+ data.z2[i])/2.0;
 			xw2= xw1* xw1+ yw1* yw1+ zw1* zw1;
 			yw2= sqrt( xw2);
-			yw2=( xw2/ yw2+ yw2)*.5;
+			//yw2=( xw2/yw2 + yw2)/2.0;
 			data.si[i]= yw2;
 			data.cab[i]= xw1/ yw2;
 			data.sab[i]= yw1/ yw2;
+	
 			xw2= zw1/ yw2;
-
 			if( xw2 > 1.0)
 			  xw2=1.0;
 			if( xw2 < -1.0)
 			  xw2=-1.0;
-
 			data.salp[i]= xw2;
-			xw2= asin( xw2)* TD;
-			yw2= atan2( yw1, xw1)* TD;
+
+			//xw2= asin( xw2)* TD;
+			//yw2= atan2( yw1, xw1)* TD;
 
 			if( (data.si[i] <= 1.0e-20) || (data.bi[i] <= 0.0) )
 			{
diff --git a/src/interface.c b/src/interface.c
index d98a064..b48e015 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -444,7 +444,7 @@ create_main_window (void)
   structure_drawingarea = gtk_drawing_area_new ();
   gtk_widget_show (structure_drawingarea);
   gtk_container_add (GTK_CONTAINER (alignment1), structure_drawingarea);
-  gtk_widget_set_size_request (structure_drawingarea, 681, 769);
+  gtk_widget_set_size_request (structure_drawingarea, 769, 769);
   GTK_WIDGET_SET_FLAGS (structure_drawingarea, GTK_CAN_FOCUS);
 
   main_hbox3 = gtk_hbox_new (FALSE, 0);
@@ -507,6 +507,7 @@ create_main_window (void)
   gtk_box_pack_start (GTK_BOX (main_hbox3), main_rotate_spinbutton, FALSE, FALSE, 0);
   gtk_tooltips_set_tip (tooltips, main_rotate_spinbutton, _("Rotate Structure\n around Z-axis"), NULL);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (main_rotate_spinbutton), TRUE);
+  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (main_rotate_spinbutton), TRUE);
 
   image51 = gtk_image_new_from_stock ("gtk-go-down", GTK_ICON_SIZE_BUTTON);
   gtk_widget_show (image51);
@@ -518,6 +519,7 @@ create_main_window (void)
   gtk_box_pack_start (GTK_BOX (main_hbox3), main_incline_spinbutton, FALSE, FALSE, 0);
   gtk_tooltips_set_tip (tooltips, main_incline_spinbutton, _("Incline Structure\nto Plane of Screen"), NULL);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (main_incline_spinbutton), TRUE);
+  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (main_incline_spinbutton), TRUE);
 
   label245 = gtk_label_new (_(" Zoom % "));
   gtk_widget_show (label245);
@@ -1190,7 +1192,7 @@ create_freqplots_window (void)
   freqplots_drawingarea = gtk_drawing_area_new ();
   gtk_widget_show (freqplots_drawingarea);
   gtk_container_add (GTK_CONTAINER (alignment2), freqplots_drawingarea);
-  gtk_widget_set_size_request (freqplots_drawingarea, 681, 769);
+  gtk_widget_set_size_request (freqplots_drawingarea, 769, 769);
   GTK_WIDGET_SET_FLAGS (freqplots_drawingarea, GTK_CAN_FOCUS);
   gtk_widget_set_events (freqplots_drawingarea, GDK_BUTTON_PRESS_MASK);
 
@@ -1731,7 +1733,6 @@ create_rdpattern_window (void)
   rdpattern_hbox2 = gtk_hbox_new (FALSE, 0);
   gtk_widget_show (rdpattern_hbox2);
   gtk_box_pack_start (GTK_BOX (vbox3), rdpattern_hbox2, FALSE, FALSE, 0);
-  gtk_widget_set_size_request (rdpattern_hbox2, -1, 30);
 
   rdpattern_colorcode_minlabel = gtk_label_new (_("0.0"));
   gtk_widget_show (rdpattern_colorcode_minlabel);
@@ -1813,7 +1814,7 @@ create_rdpattern_window (void)
   rdpattern_drawingarea = gtk_drawing_area_new ();
   gtk_widget_show (rdpattern_drawingarea);
   gtk_container_add (GTK_CONTAINER (alignment3), rdpattern_drawingarea);
-  gtk_widget_set_size_request (rdpattern_drawingarea, 681, 769);
+  gtk_widget_set_size_request (rdpattern_drawingarea, 769, 769);
   GTK_WIDGET_SET_FLAGS (rdpattern_drawingarea, GTK_CAN_FOCUS);
 
   rdpattern_hbox3 = gtk_hbox_new (FALSE, 0);
@@ -1868,6 +1869,7 @@ create_rdpattern_window (void)
   gtk_box_pack_start (GTK_BOX (rdpattern_hbox3), rdpattern_rotate_spinbutton, TRUE, TRUE, 0);
   gtk_tooltips_set_tip (tooltips, rdpattern_rotate_spinbutton, _("Rotate radiation pattern around Z-axis"), NULL);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (rdpattern_rotate_spinbutton), TRUE);
+  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rdpattern_rotate_spinbutton), TRUE);
 
   image56 = gtk_image_new_from_stock ("gtk-go-down", GTK_ICON_SIZE_BUTTON);
   gtk_widget_show (image56);
@@ -1879,6 +1881,7 @@ create_rdpattern_window (void)
   gtk_box_pack_start (GTK_BOX (rdpattern_hbox3), rdpattern_incline_spinbutton, TRUE, TRUE, 0);
   gtk_tooltips_set_tip (tooltips, rdpattern_incline_spinbutton, _("Incline radiation pattern to plane of screen"), NULL);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (rdpattern_incline_spinbutton), TRUE);
+  gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (rdpattern_incline_spinbutton), TRUE);
 
   label247 = gtk_label_new (_(" Zoom % "));
   gtk_widget_show (label247);
@@ -2620,7 +2623,7 @@ create_nec2_editor (void)
   nec2_cmnt_treeview = gtk_tree_view_new ();
   gtk_widget_show (nec2_cmnt_treeview);
   gtk_container_add (GTK_CONTAINER (scrolledwindow5), nec2_cmnt_treeview);
-  gtk_widget_set_size_request (nec2_cmnt_treeview, -1, 170);
+  gtk_widget_set_size_request (nec2_cmnt_treeview, 769, 176);
   gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (nec2_cmnt_treeview), TRUE);
   gtk_tree_view_set_reorderable (GTK_TREE_VIEW (nec2_cmnt_treeview), TRUE);
 
@@ -2722,7 +2725,7 @@ create_nec2_editor (void)
   nec2_geom_treeview = gtk_tree_view_new ();
   gtk_widget_show (nec2_geom_treeview);
   gtk_container_add (GTK_CONTAINER (scrolledwindow4), nec2_geom_treeview);
-  gtk_widget_set_size_request (nec2_geom_treeview, -1, 170);
+  gtk_widget_set_size_request (nec2_geom_treeview, 769, 176);
   gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (nec2_geom_treeview), TRUE);
   gtk_tree_view_set_reorderable (GTK_TREE_VIEW (nec2_geom_treeview), TRUE);
 
@@ -2852,7 +2855,7 @@ create_nec2_editor (void)
   nec2_cmnd_treeview = gtk_tree_view_new ();
   gtk_widget_show (nec2_cmnd_treeview);
   gtk_container_add (GTK_CONTAINER (scrolledwindow3), nec2_cmnd_treeview);
-  gtk_widget_set_size_request (nec2_cmnd_treeview, -1, 170);
+  gtk_widget_set_size_request (nec2_cmnd_treeview, 769, 176);
   gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (nec2_cmnd_treeview), TRUE);
   gtk_tree_view_set_reorderable (GTK_TREE_VIEW (nec2_cmnd_treeview), TRUE);
 
diff --git a/src/main.c b/src/main.c
index 28a0bf8..cd7ea73 100644
--- a/src/main.c
+++ b/src/main.c
@@ -76,7 +76,7 @@ main (int argc, char *argv[])
 			  _("xnec2c: input file name too long (>80 char)\n") );
 		  exit(-1);
 		}
-		Strlcpy( infile, optarg, strlen(optarg)+1 ); /* For null term. */
+		Strlcpy( infile, optarg, sizeof(infile) ); /* For null term. */
 		break;
 
 	  case 'j': /* number of child processes = num of processors */
@@ -109,7 +109,7 @@ main (int argc, char *argv[])
 		  _("xnec2c: input file path name too long (>80 char)\n") );
 	  exit(-1);
 	}
-	Strlcpy( infile, argv[argc-1], strlen(argv[argc-1])+1 ); /* For null term. */
+	Strlcpy( infile, argv[argc-1], sizeof(infile) ); /* For null term. */
   }
 
   /* When forking is useful, e.g. if more than 1 processor is
@@ -121,12 +121,12 @@ main (int argc, char *argv[])
   if( calc_data.num_jobs > 1 )
   {
 	size_t mreq = (size_t)calc_data.num_jobs * sizeof(forked_proc_data_t *);
-	mem_alloc( (void *)&forked_proc_data, mreq, "in main.c" );
+	mem_alloc( (void **)&forked_proc_data, mreq, "in main.c" );
 	for( idx = 0; idx < calc_data.num_jobs; idx++ )
 	{
 	  forked_proc_data[idx] = NULL;
 	  mreq = sizeof(forked_proc_data_t);
-	  mem_alloc( (void *)&forked_proc_data[idx], mreq, "in main.c" );
+	  mem_alloc( (void **)&forked_proc_data[idx], mreq, "in main.c" );
 	}
 
 	/* Fork child processes */
@@ -137,7 +137,8 @@ main (int argc, char *argv[])
 	  if( err )
 	  {
 		perror( "xnec2c: pipe()" );
-		puts( _("xnec2c: exiting after fatal error (pipe() failed)") );
+		fprintf( stderr,
+			_("xnec2c: exiting after fatal error (pipe() failed)") );
 		exit(-1);
 	  }
 
@@ -145,7 +146,8 @@ main (int argc, char *argv[])
 	  if( err )
 	  {
 		perror( "xnec2c: pipe()" );
-		puts( _("xnec2c: exiting after fatal error (pipe() failed)") );
+		fprintf( stderr,
+			_("xnec2c: exiting after fatal error (pipe() failed)") );
 		exit(-1);
 	  }
 
@@ -154,7 +156,8 @@ main (int argc, char *argv[])
 	  if( forked_proc_data[idx]->child_pid == -1 )
 	  {
 		perror( "xnec2c: fork()" );
-		puts( _("xnec2c: exiting after fatal error (fork() failed)") );
+		fprintf( stderr,
+			_("xnec2c: exiting after fatal error (fork() failed)") );
 		exit(-1);
 	  }
 	  else child_pid = forked_proc_data[idx]->child_pid;
@@ -227,7 +230,7 @@ main (int argc, char *argv[])
 		main_window, "main_rotate_spinbutton"));
   incline_structure = GTK_SPIN_BUTTON(lookup_widget(
 		main_window, "main_incline_spinbutton"));
-  structure_zoom_spinbutton = GTK_SPIN_BUTTON(lookup_widget(
+  structure_zoom = GTK_SPIN_BUTTON(lookup_widget(
 		main_window, "structure_zoom_spinbutton"));
   structure_fstep_entry = GTK_ENTRY(lookup_widget(
 		main_window, "structure_fstep_entry")) ;
@@ -244,8 +247,7 @@ main (int argc, char *argv[])
   rdpattern_proj_params.xy_zoom = 1.0;
   rdpattern_proj_params.reset = TRUE;
   rdpattern_proj_params.type = RDPATTERN_DRAWINGAREA;
-
-  New_Structure_Projection_Angle();
+  calc_data.zo = 50.0;
 
   /* Open input file if specified */
   if( strlen(infile) > 0 )
@@ -280,6 +282,7 @@ Open_Input_File( gpointer udata )
   /* Suppress activity while input file opened */
   ClearFlag( OPEN_INPUT_FLAGS );
   SetFlag( INPUT_PENDING );
+  calc_data.fstep = -1;
 
   /* Open NEC2 input file */
   Open_File( &input_fp, infile, "r");
@@ -347,6 +350,7 @@ Open_Input_File( gpointer udata )
   if( nec2_edit_window == NULL )
 	New_Viewer_Angle( 45.0, 45.0, rotate_structure,
 		incline_structure, &structure_proj_params );
+  New_Structure_Projection_Angle();
 
   /* Show current frequency */
   gtk_spin_button_set_value(
@@ -379,8 +383,7 @@ Open_Input_File( gpointer udata )
   else
 	Nec2_Input_File_Treeview( NEC2_EDITOR_RELOAD );
 
-  /* Disable freq step and display sructure */
-  calc_data.fstep = -1;
+  /* Display sructure */
   Draw_Structure( structure_drawingarea );
 
   /* Re-initialize Rad Pattern drawing if window open */
diff --git a/src/matrix.c b/src/matrix.c
index e4c8396..89997f9 100644
--- a/src/matrix.c
+++ b/src/matrix.c
@@ -154,7 +154,7 @@ void cmset( int nrow, complex double *cmx, double rkhx, int iexkx )
 
   /* Allocate to scratch memory */
   size_t mreq = (size_t)data.np2m * sizeof(complex double);
-  mem_alloc( (void *)&scm, mreq, "in matrix.c");
+  mem_alloc( (void **)&scm, mreq, "in matrix.c");
 
   /* combine elements for symmetry modes */
   for( i = 0; i < it; i++ )
@@ -191,7 +191,7 @@ void cmset( int nrow, complex double *cmx, double rkhx, int iexkx )
 
   } /* for( i = 0; i < it; i++ ) */
 
-  free_ptr( (void *)&scm );
+  free_ptr( (void **)&scm );
 
   return;
 }
@@ -312,7 +312,7 @@ void cmsw( int j1, int j2, int i1, int i2, complex double *cmx,
   static complex double *emel = NULL;
 
   size_t mreq = 9 * sizeof(complex double);
-  mem_alloc( (void *)&emel, mreq, "in matrix.c");
+  mem_alloc( (void **)&emel, mreq, "in matrix.c");
 
   jsnox = segj.jsno-1;
 
@@ -1126,7 +1126,7 @@ void factr( int n, complex double *a, int *ip, int ndim)
 
   /* Allocate to scratch memory */
   size_t mreq = (size_t)data.np2m * sizeof(complex double);
-  mem_alloc( (void *)&scm, mreq, "in matrix.c");
+  mem_alloc( (void **)&scm, mreq, "in matrix.c");
 
   /* Un-transpose the matrix for Gauss elimination */
   for( i = 1; i < n; i++ )
@@ -1206,7 +1206,7 @@ void factr( int n, complex double *a, int *ip, int ndim)
 
   } /* for( r=0; r < n; r++ ) */
 
-  free_ptr( (void *)&scm );
+  free_ptr( (void **)&scm );
 
   return;
 }
@@ -1325,7 +1325,7 @@ solve( int n, complex double *a, int *ip,
 
   /* Allocate to scratch memory */
   size_t mreq = (size_t)data.np2m * sizeof(complex double);
-  mem_alloc( (void *)&scm, mreq, "in matrix.c");
+  mem_alloc( (void **)&scm, mreq, "in matrix.c");
 
   /* forward substitution */
   for( i = 0; i < n; i++ )
@@ -1354,7 +1354,7 @@ solve( int n, complex double *a, int *ip,
 	b[i]=( scm[i]- sum)/ a[i+i*ndim];
   }
 
-  free_ptr( (void *)&scm );
+  free_ptr( (void **)&scm );
 
   return;
 }
@@ -1381,7 +1381,7 @@ solves( complex double *a, int *ip,
 
   /* Allocate to scratch memory */
   size_t mreq = (size_t)data.np2m * sizeof(complex double);
-  mem_alloc( (void *)&scm, mreq, "in matrix.c");
+  mem_alloc( (void **)&scm, mreq, "in matrix.c");
 
   if( smat.nop != 1)
   {
@@ -1469,7 +1469,7 @@ solves( complex double *a, int *ip,
 
   if( smat.nop == 1)
   {
-	free_ptr( (void *)&scm );
+	free_ptr( (void **)&scm );
 	return;
   }
 
@@ -1540,7 +1540,7 @@ solves( complex double *a, int *ip,
 
   } /* for( ic = 0; ic < nrh; ic++ ) */
 
-  free_ptr( (void *)&scm );
+  free_ptr( (void **)&scm );
 
   return;
 }
diff --git a/src/nec2_model.c b/src/nec2_model.c
index 966320d..9512b7f 100644
--- a/src/nec2_model.c
+++ b/src/nec2_model.c
@@ -176,7 +176,7 @@ Create_Default_File( void )
   gtk_list_store_clear( cmnd_store );
 
   /* Append a default comment row */
-  Strlcpy( str, _("--- NEC2 Input File created by "), s );
+  Strlcpy( str, _("--- NEC2 Input File created or edited by "), s );
   Strlcat( str, PACKAGE_STRING, s );
   Strlcat( str, " ---", s );
   gtk_list_store_append( cmnt_store, &iter );
@@ -347,7 +347,7 @@ List_Comments( void )
 	if( strlen(line_buf) == 2 ) line_buf[3] = '\0';
 
 	/* Separate card's id mnemonic */
-	Strlcpy( ain, line_buf, 3 );
+	Strlcpy( ain, line_buf, sizeof(ain) );
 
 	/* Append a comment row and fill in text if opening call */
 	if( !ret )
@@ -409,7 +409,7 @@ List_Geometry( void )
 
 	/* Format card data and print to string */
 	snprintf( si[0], 6, "%5d",  iv[0] );
-	snprintf( si[1], 6, "%5d ", iv[1] );
+	snprintf( si[1], 7, "%5d ", iv[1] );
 	for( idx = GEOM_COL_F1; idx <= GEOM_COL_F7; idx++ )
 	  snprintf( sf[idx-GEOM_COL_F1], 13,
 		  "%12.5E", (double)fv[idx-GEOM_COL_F1] );
@@ -509,7 +509,10 @@ List_Commands( void )
 
 /*------------------------------------------------------------------------*/
 
-/* Inserts columns in a list store */
+/* Insert_Columns()
+ *
+ * Inserts columns in a list store
+ */
   void
 Insert_Columns(	GtkWidget *window, gchar *treeview,
 	GtkListStore* store, int ncols, char *colname[] )
diff --git a/src/network.c b/src/network.c
index 875ae56..2d7f9af 100644
--- a/src/network.c
+++ b/src/network.c
@@ -68,25 +68,25 @@ void netwk( complex double *cmx, int *ip, complex double *einc )
   if( netcx.nonet > 0 )
   {
 	mreq = (size_t)data.np3m * sizeof(complex double);
-	mem_alloc( (void *)&rhs, mreq, "in network.c");
+	mem_alloc( (void **)&rhs, mreq, "in network.c");
 
 	mreq = (size_t)j * sizeof(complex double);
-	mem_alloc( (void *)&rhnt, mreq, "in network.c");
-	mem_alloc( (void *)&rhnx, mreq, "in network.c");
-	mem_alloc( (void *)&cmn,  mreq * (size_t)j, "in network.c");
+	mem_alloc( (void **)&rhnt, mreq, "in network.c");
+	mem_alloc( (void **)&rhnx, mreq, "in network.c");
+	mem_alloc( (void **)&cmn,  mreq * (size_t)j, "in network.c");
 
 	mreq = (size_t)j * sizeof(int);
-	mem_alloc( (void *)&ntsca, mreq, "in network.c");
-	mem_alloc( (void *)&nteqa, mreq, "in network.c");
-	mem_alloc( (void *)&ipnt,  mreq, "in network.c");
+	mem_alloc( (void **)&ntsca, mreq, "in network.c");
+	mem_alloc( (void **)&nteqa, mreq, "in network.c");
+	mem_alloc( (void **)&ipnt,  mreq, "in network.c");
 
 	mreq = (size_t)vsorc.nsant * sizeof(complex double);
-	mem_alloc( (void *)&vsrc, mreq, "in network.c");
+	mem_alloc( (void **)&vsrc, mreq, "in network.c");
   }
   else if( netcx.masym != 0)
   {
 	mreq = (size_t)j * sizeof(int);
-	mem_alloc( (void *)&ipnt,  mreq, "in network.c");
+	mem_alloc( (void **)&ipnt,  mreq, "in network.c");
   }
 
   /* Signal new and valid current data */
@@ -518,14 +518,14 @@ void netwk( complex double *cmx, int *ip, complex double *einc )
   if( (vsorc.nsant+vsorc.nvqd) == 0)
   {
 	/* Free network buffers */
-	free_ptr( (void *)&ipnt );
-	free_ptr( (void *)&nteqa );
-	free_ptr( (void *)&ntsca );
-	free_ptr( (void *)&vsrc );
-	free_ptr( (void *)&rhs );
-	free_ptr( (void *)&cmn );
-	free_ptr( (void *)&rhnt );
-	free_ptr( (void *)&rhnx );
+	free_ptr( (void **)&ipnt );
+	free_ptr( (void **)&nteqa );
+	free_ptr( (void **)&ntsca );
+	free_ptr( (void **)&vsrc );
+	free_ptr( (void **)&rhs );
+	free_ptr( (void **)&cmn );
+	free_ptr( (void **)&rhnt );
+	free_ptr( (void **)&rhnx );
 	return;
   }
 
@@ -583,14 +583,14 @@ void netwk( complex double *cmx, int *ip, complex double *einc )
 	} /* for( i = 0; i < vsorc.nvqd; i++ ) */
 
   /* Free network buffers */
-  free_ptr( (void *)&ipnt );
-  free_ptr( (void *)&nteqa );
-  free_ptr( (void *)&ntsca );
-  free_ptr( (void *)&vsrc );
-  free_ptr( (void *)&rhs );
-  free_ptr( (void *)&cmn );
-  free_ptr( (void *)&rhnt );
-  free_ptr( (void *)&rhnx );
+  free_ptr( (void **)&ipnt );
+  free_ptr( (void **)&nteqa );
+  free_ptr( (void **)&ntsca );
+  free_ptr( (void **)&vsrc );
+  free_ptr( (void **)&rhs );
+  free_ptr( (void **)&cmn );
+  free_ptr( (void **)&rhnt );
+  free_ptr( (void **)&rhnx );
 
   return;
 }
diff --git a/src/plot_freqdata.c b/src/plot_freqdata.c
index a7d50de..5f38555 100644
--- a/src/plot_freqdata.c
+++ b/src/plot_freqdata.c
@@ -130,13 +130,13 @@ Plot_Frequency_Data( void )
 
 	/* Allocate max gmax and directions */
 	size_t mreq = (size_t)fstep * sizeof(double);
-	mem_realloc( (void *)&gmax,     mreq, "in plot_freqdata.c" );
-	mem_realloc( (void *)&gdir_tht, mreq, "in plot_freqdata.c" );
-	mem_realloc( (void *)&gdir_phi, mreq, "in plot_freqdata.c" );
-	mem_realloc( (void *)&fbratio,  mreq, "in plot_freqdata.c" );
+	mem_realloc( (void **)&gmax,     mreq, "in plot_freqdata.c" );
+	mem_realloc( (void **)&gdir_tht, mreq, "in plot_freqdata.c" );
+	mem_realloc( (void **)&gdir_phi, mreq, "in plot_freqdata.c" );
+	mem_realloc( (void **)&fbratio,  mreq, "in plot_freqdata.c" );
 
 	if( isFlagSet(PLOT_NETGAIN) )
-	  mem_realloc( (void *)&netgain, mreq, "in plot_freqdata.c" );
+	  mem_realloc( (void **)&netgain, mreq, "in plot_freqdata.c" );
 
 	/* Find max gain and direction, F/B ratio */
 	no_fbr = FALSE;
@@ -157,7 +157,7 @@ Plot_Frequency_Data( void )
 
 	  /* Max gain for given polarization type */
 	  gmax[idx] = rad_pattern[idx].gtot[mgidx] +
-		10.0 * log10( Polarization_Factor(pol, idx, mgidx) );
+		Polarization_Factor(pol, idx, mgidx);
 
 	  /* Net gain if selected */
 	  if( isFlagSet(PLOT_NETGAIN) )
@@ -214,8 +214,8 @@ Plot_Frequency_Data( void )
 	  /* Front to back ratio */
 	  fbratio[idx]  = pow( 10.0, gmax[idx] / 10.0 );
 	  fbratio[idx] /= pow( 10.0,
-		  rad_pattern[idx].gtot[fbidx] / 10.0 +
-		  log10(Polarization_Factor(pol, idx, fbidx)) );
+		  (rad_pattern[idx].gtot[fbidx] +
+		   Polarization_Factor(pol, idx, fbidx)) / 10.0 );
 	  fbratio[idx] = 10.0 * log10( fbratio[idx] );
 
 	} /* for( idx = 0; idx < fstep; idx++ ) */
@@ -276,7 +276,7 @@ Plot_Frequency_Data( void )
 
 	/* Allocate viewer gain buffer */
 	size_t mreq = (size_t)fstep * sizeof(double);
-	mem_realloc( (void *)&vgain, mreq, "in plot_freqdata.c" );
+	mem_realloc( (void **)&vgain, mreq, "in plot_freqdata.c" );
 
 	/* Calcs are done for all freq steps */
 	for( idx = 0; idx < fstep; idx++ )
@@ -286,7 +286,7 @@ Plot_Frequency_Data( void )
 	if( isFlagSet(PLOT_NETGAIN) )
 	{
 	  mreq = (size_t)fstep * sizeof(double);
-	  mem_realloc( (void *)&netgain, mreq, "in plot_freqdata.c" );
+	  mem_realloc( (void **)&netgain, mreq, "in plot_freqdata.c" );
 
 	  Zo = calc_data.zo;
 	  for( idx = 0; idx < fstep; idx++ )
@@ -323,7 +323,7 @@ Plot_Frequency_Data( void )
 	titles[1] = _("VSWR vs Frequency");
 
 	/* Calculate VSWR */
-	mem_alloc( (void *)&vswr,
+	mem_alloc( (void **)&vswr,
 		(size_t)calc_data.nfrq * sizeof(double),
 		"in Plot_Frequency_Data()" );
 	if( vswr == NULL )
@@ -351,7 +351,7 @@ Plot_Frequency_Data( void )
 	  Plot_Graph( vswr, save.freq, fstep,
 		  titles, calc_data.ngraph, ++posn );
 
-	free_ptr( (void *)&vswr );
+	free_ptr( (void **)&vswr );
   } /* if( isFlagSet(PLOT_VSWR) ) */
 
   /* Plot z-real and z-imag */
@@ -427,11 +427,10 @@ Display_Frequency_Data( void )
 	/* Max gain for given polarization type */
 	int mgidx = rad_pattern[fstep].max_gain_idx[pol];
 	double gmax = rad_pattern[fstep].gtot[mgidx] +
-	  10.0 * log10( Polarization_Factor(pol, fstep, mgidx) );
+	  Polarization_Factor(pol, fstep, mgidx);
 
 	/* Display max gain */
 	snprintf( txt, 6, "%5f", gmax );
-	txt[5] = '\0';
 	gtk_entry_set_text( GTK_ENTRY(lookup_widget(
 			freqplots_window, "freqplots_maxgain_entry")), txt );
 
@@ -439,7 +438,6 @@ Display_Frequency_Data( void )
 
   /* Display frequency */
   snprintf( txt, 11, "%10.3f", (double)calc_data.fmhz );
-  txt[10] = '\0';
   gtk_entry_set_text( GTK_ENTRY(lookup_widget(
 		  freqplots_window, "freqplots_fmhz_entry")), txt );
 
@@ -457,19 +455,16 @@ Display_Frequency_Data( void )
 
   /* Display VSWR */
   snprintf( txt, 6, "%5f", vswr );
-  txt[5] = '\0';
   gtk_entry_set_text( GTK_ENTRY(lookup_widget(
 		  freqplots_window, "freqplots_vswr_entry")), txt );
 
   /* Display Z real */
   snprintf( txt, 6, "%5f", (double)creal( netcx.zped ) );
-  txt[5] = '\0';
   gtk_entry_set_text( GTK_ENTRY(lookup_widget(
 		  freqplots_window, "freqplots_zreal_entry")), txt );
 
   /* Display Z imaginary */
   snprintf( txt, 6, "%5f", (double)cimag( netcx.zped ) );
-  txt[5] = '\0';
   gtk_entry_set_text( GTK_ENTRY(lookup_widget(
 		  freqplots_window, "freqplots_zimag_entry")), txt );
 
@@ -614,7 +609,6 @@ Plot_Vertical_Scale(
   if( order > 3 ) order = 3;
   if( order < 0 ) order = 0;
   snprintf( format, 6, "%%6.%df", (3-order) );
-  format[5] = '\0';
 
   /* Create a pango layout */
   layout = gtk_widget_create_pango_layout(
@@ -628,7 +622,6 @@ Plot_Vertical_Scale(
   {
 	yps = y + (idx * height) / (nval-1);
 	snprintf( value, 16, (const char *)format, max );
-	value[15] = '\0';
 	pango_layout_set_text( layout, value, -1 );
 	cairo_move_to( cr, x, yps );
 	pango_cairo_show_layout( cr, layout );
@@ -676,7 +669,6 @@ Plot_Horizontal_Scale(
   if( order > 0 )  order = 0;
   if( order < -9 ) order = -9;
   snprintf( format, 6, "%%6.%df", 1-order );
-  format[5] = '\0';
 
   /* Create a pango layout */
   layout = gtk_widget_create_pango_layout(
@@ -689,8 +681,7 @@ Plot_Horizontal_Scale(
   for( idx = 0; idx < nval; idx++ )
   {
 	xps = x + (idx * width) / (nval-1);
-	snprintf( value, 16, (const char *)format, min );
-	value[15] = '\0';
+	snprintf( value, sizeof(value), (const char *)format, min );
 	pango_layout_set_text( layout, value, -1 );
 	cairo_move_to( cr, xps, y );
 	pango_cairo_show_layout( cr, layout );
@@ -729,7 +720,7 @@ Draw_Graph(
   rb = bmax - bmin;
 
   /* Calculate points to plot */
-  mem_alloc( (void *)&points,
+  mem_alloc( (void **)&points,
 	  (size_t)calc_data.nfrq * sizeof(GdkPoint),
 	  "in Plot_Frequency_Data()" );
   if( points == NULL )
@@ -769,7 +760,7 @@ Draw_Graph(
   /* Draw the graph */
   Cairo_Draw_Lines( cr, points, nval );
 
-  free_ptr( (void *)&points );
+  free_ptr( (void **)&points );
   cairo_destroy( cr );
 } /* Draw_Graph() */
 
diff --git a/src/radiation.c b/src/radiation.c
index 4a3d999..9dd5d19 100644
--- a/src/radiation.c
+++ b/src/radiation.c
@@ -282,8 +282,8 @@ void ffld( double thet, double phi,
 	  jump = TRUE;
 	else
 	{
-	  *eth=( cix* thx+ ciy* thy+ ciz* thz)* CONST3;
-	  *eph=( cix* phx+ ciy* phy)* CONST3;
+	  *eth = ( cix * thx + ciy * thy + ciz * thz ) * CONST3;
+	  *eph = ( cix * phx + ciy * phy ) * CONST3;
 	  return;
 	}
 
@@ -339,11 +339,12 @@ void ffld( double thet, double phi,
 
   } /* for( ip = 0; ip < gnd.ksymp; ip++ ) */
 
-  ex= ex+ cix* CONST3;
-  ey= ey+ ciy* CONST3;
-  ez= ez+ ciz* CONST3;
-  *eth= ex* thx+ ey* thy+ ez* thz;
-  *eph= ex* phx+ ey* phy;
+  ex = ex + cix * CONST3;
+  ey = ey + ciy * CONST3;
+  ez = ez + ciz * CONST3;
+  
+  *eth = ex * thx + ey * thy + ez * thz;
+  *eph = ex * phx + ey * phy;
 
   return;
 }
@@ -756,8 +757,8 @@ void rdpat(void)
 		/* Find and save max value of gain and direction */
 		for( pol = 0; pol < NUM_POL; pol++ )
 		{
-		  gain = rad_pattern[calc_data.fstep].gtot[idx] + 10.0 *
-			log10( Polarization_Factor( pol, calc_data.fstep, idx) );
+		  gain = rad_pattern[calc_data.fstep].gtot[idx] +
+			Polarization_Factor( pol, calc_data.fstep, idx);
 		  if( gain < -999.99 ) gain = -999.99;
 
 		  /* Find and save max value of gain and direction */
diff --git a/src/shared.c b/src/shared.c
index faaa78e..2915d02 100644
--- a/src/shared.c
+++ b/src/shared.c
@@ -42,8 +42,10 @@ GtkSpinButton
   *incline_rdpattern   = NULL,
   *rotate_structure    = NULL,
   *incline_structure   = NULL,
+  *rdpattern_zoom      = NULL,
+  *structure_zoom      = NULL,
   *rdpattern_frequency = NULL,
-  *rdpattern_zoom_spinbutton = NULL;
+  *mainwin_frequency = NULL;
 
 projection_parameters_t
   rdpattern_proj_params,
@@ -74,9 +76,6 @@ GtkWidget *rdpattern_drawingarea = NULL;
 /* Motion event handler id */
 gulong rdpattern_motion_handler;
 
-/* Main window freq spinbutton */
-GtkSpinButton *mainwin_frequency;
-
 /* Dialog widgets */
 GtkWidget *quit_dialog	  = NULL;
 GtkWidget *animate_dialog = NULL;
@@ -93,9 +92,6 @@ char *fork_commands[] = FORK_CMNDS;
 /* Forked process data */
 forked_proc_data_t **forked_proc_data = NULL;
 
-/* Zoom spin button */
-GtkSpinButton *structure_zoom_spinbutton = NULL;
-
 /* Number of forked child processes */
 int num_child_procs = 0;
 
diff --git a/src/shared.h b/src/shared.h
index 7c315a2..2b689e5 100644
--- a/src/shared.h
+++ b/src/shared.h
@@ -43,7 +43,8 @@ extern GtkSpinButton
   *rotate_structure,
   *incline_structure,
   *rdpattern_frequency,
-  *rdpattern_zoom_spinbutton ;
+  *rdpattern_zoom,
+  *structure_zoom;
 
 /* Motion event handler id */
 extern gulong structure_motion_handler;
@@ -58,9 +59,6 @@ extern projection_parameters_t
   rdpattern_proj_params,
   structure_proj_params;
 
-/* Zoom spin button */
-extern GtkSpinButton *structure_zoom_spinbutton;
-
 /* Number of forked child processes */
 extern int num_child_procs;
 
@@ -169,7 +167,7 @@ extern data_t data;
 extern FILE *input_fp, *output_fp, *plot_fp;
 
 /* Input file name */
-extern char infile[];
+extern char infile[81];
 
 /* common  /fpat/ */
 extern fpat_t fpat;
@@ -207,6 +205,8 @@ extern vsorc_t vsorc;
 /* common  /zload/ */
 extern zload_t zload;
 
+#define MOTION_EVENTS_COUNT 8
+
 /*------------------------------------------------------------------------*/
 
 #endif
diff --git a/src/somnec.c b/src/somnec.c
index 3e6524c..edc66cb 100644
--- a/src/somnec.c
+++ b/src/somnec.c
@@ -63,21 +63,21 @@ void somnec( double epr, double sig, double fmhz )
 
 	/* Allocate some buffers */
 	size_t mreq = sizeof(complex double) * 11 * 10 * 4;
-	mem_alloc( (void *)&ggrid.ar1, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.ar1, mreq, "in somnec.c");
 	mreq = sizeof(complex double) * 17 * 5 * 4;
-	mem_alloc( (void *)&ggrid.ar2, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.ar2, mreq, "in somnec.c");
 	mreq = sizeof(complex double) * 9 * 8 * 4;
-	mem_alloc( (void *)&ggrid.ar3, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.ar3, mreq, "in somnec.c");
 
 	mreq = sizeof(int) * 3;
-	mem_alloc( (void *)&ggrid.nxa, mreq, "in somnec.c");
-	mem_alloc( (void *)&ggrid.nya, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.nxa, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.nya, mreq, "in somnec.c");
 
 	mreq = sizeof(double) * 3;
-	mem_alloc( (void *)&ggrid.dxa, mreq, "in somnec.c");
-	mem_alloc( (void *)&ggrid.dya, mreq, "in somnec.c");
-	mem_alloc( (void *)&ggrid.xsa, mreq, "in somnec.c");
-	mem_alloc( (void *)&ggrid.ysa, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.dxa, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.dya, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.xsa, mreq, "in somnec.c");
+	mem_alloc( (void **)&ggrid.ysa, mreq, "in somnec.c");
 
 	/* Initialize ground grid parameters for somnec */
 	ggrid.nxa[0] = 11;
@@ -256,9 +256,9 @@ void bessel( complex double z,
 	int i;
 
 	size_t mreq = 101 * sizeof(double);
-	mem_alloc( (void *)&m, mreq, "in somnec.c");
-	mem_alloc( (void *)&a1, mreq, "in somnec.c");
-	mem_alloc( (void *)&a2, mreq, "in somnec.c");
+	mem_alloc( (void **)&m, mreq, "in somnec.c");
+	mem_alloc( (void **)&a1, mreq, "in somnec.c");
+	mem_alloc( (void **)&a2, mreq, "in somnec.c");
 
 	for( k = 1; k <= 25; k++ )
 	{
@@ -366,8 +366,8 @@ evlua( complex double *erv, complex double *ezv,
   {
 	first_call = FALSE;
 	size_t mreq = 6 * sizeof(complex double);
-	mem_alloc( (void *)&sum, mreq, "in somnec.c");
-	mem_alloc( (void *)&ans, mreq, "in somnec.c");
+	mem_alloc( (void **)&sum, mreq, "in somnec.c");
+	mem_alloc( (void **)&ans, mreq, "in somnec.c");
   }
 
   del=zph;
@@ -578,11 +578,11 @@ gshank( complex double start, complex double dela,
   {
 	first_call = FALSE;
 	size_t mreq = 6 * 20 * sizeof(complex double);
-	mem_alloc( (void *)&q1, mreq, "in somnec.c");
-	mem_alloc( (void *)&q2, mreq, "in somnec.c");
+	mem_alloc( (void **)&q1, mreq, "in somnec.c");
+	mem_alloc( (void **)&q2, mreq, "in somnec.c");
 	mreq = 6 * sizeof(complex double);
-	mem_alloc( (void *)&ans1, mreq, "in somnec.c");
-	mem_alloc( (void *)&ans2, mreq, "in somnec.c");
+	mem_alloc( (void **)&ans1, mreq, "in somnec.c");
+	mem_alloc( (void **)&ans2, mreq, "in somnec.c");
   }
 
   rbk=creal(bk);
@@ -752,12 +752,12 @@ hankel( complex double z,
   {
 	first_call = FALSE;
 	size_t mreq = 101 * sizeof(int);
-	mem_alloc( (void *)&m, mreq, "in somnec.c");
+	mem_alloc( (void **)&m, mreq, "in somnec.c");
 	mreq = 25 * sizeof(double);
-	mem_alloc( (void *)&a1, mreq, "in somnec.c");
-	mem_alloc( (void *)&a2, mreq, "in somnec.c");
-	mem_alloc( (void *)&a3, mreq, "in somnec.c");
-	mem_alloc( (void *)&a4, mreq, "in somnec.c");
+	mem_alloc( (void **)&a1, mreq, "in somnec.c");
+	mem_alloc( (void **)&a2, mreq, "in somnec.c");
+	mem_alloc( (void **)&a3, mreq, "in somnec.c");
+	mem_alloc( (void **)&a4, mreq, "in somnec.c");
   }
 
   /* initialization of constants */
@@ -890,14 +890,14 @@ void rom1( int n, complex double *sum, int nx )
   {
 	first_call = FALSE;
 	size_t mreq = 6 * sizeof(complex double);
-	mem_alloc( (void *)&g1, mreq, "in somnec.c");
-	mem_alloc( (void *)&g2, mreq, "in somnec.c");
-	mem_alloc( (void *)&g3, mreq, "in somnec.c");
-	mem_alloc( (void *)&g4, mreq, "in somnec.c");
-	mem_alloc( (void *)&g5, mreq, "in somnec.c");
-	mem_alloc( (void *)&t01, mreq, "in somnec.c");
-	mem_alloc( (void *)&t10, mreq, "in somnec.c");
-	mem_alloc( (void *)&t20, mreq, "in somnec.c");
+	mem_alloc( (void **)&g1, mreq, "in somnec.c");
+	mem_alloc( (void **)&g2, mreq, "in somnec.c");
+	mem_alloc( (void **)&g3, mreq, "in somnec.c");
+	mem_alloc( (void **)&g4, mreq, "in somnec.c");
+	mem_alloc( (void **)&g5, mreq, "in somnec.c");
+	mem_alloc( (void **)&t01, mreq, "in somnec.c");
+	mem_alloc( (void **)&t10, mreq, "in somnec.c");
+	mem_alloc( (void **)&t20, mreq, "in somnec.c");
   }
 
   lstep=0;
diff --git a/src/utils.c b/src/utils.c
index fa09732..4caa18f 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -201,15 +201,15 @@ int Load_Line( char *buff, FILE *pfile )
 static size_t cnt = 0; /* Total allocation */
 void mem_alloc( void **ptr, size_t req, gchar *str )
 {
-  gchar mesg[100];
+  gchar mesg[MESG_SIZE];
 
   free_ptr( ptr );
   *ptr = malloc( req );
   cnt += req;
   if( *ptr == NULL )
   {
-	snprintf( mesg, 99, _("Memory allocation denied %s\n"), str );
-	mesg[99] = '\0';
+	snprintf( mesg, sizeof(mesg),
+		_("Memory allocation denied %s\n"), str );
 	fprintf( stderr, "%s: Total memory request %ld\n", mesg, cnt );
 	stop( mesg, ERR_STOP );
   }
@@ -220,14 +220,14 @@ void mem_alloc( void **ptr, size_t req, gchar *str )
 
 void mem_realloc( void **ptr, size_t req, gchar *str )
 {
-  gchar mesg[100];
+  gchar mesg[MESG_SIZE];
 
   *ptr = realloc( *ptr, req );
   cnt += req;
   if( *ptr == NULL )
   {
-	snprintf( mesg, 99, _("Memory re-allocation denied %s\n"), str );
-	mesg[99] = '\0';
+	snprintf( mesg, sizeof(mesg),
+		_("Memory re-allocation denied %s\n"), str );
 	fprintf( stderr, "%s: Total memory request %ld\n", mesg, cnt );
 	stop( mesg, ERR_STOP );
   }
@@ -260,10 +260,9 @@ Open_File( FILE **fp, char *fname, const char *mode )
   Close_File( fp );
   if( (*fp = fopen(fname, mode)) == NULL )
   {
-	char mesg[110];
-	snprintf( mesg, 109,
+	char mesg[MESG_SIZE];
+	snprintf( mesg, sizeof(mesg),
 		_("xnec2c: %s: Failed to open file\n"), fname );
-	mesg[109] = '\0';
 	stop( mesg, ERR_STOP );
 	return( FALSE );
   }
@@ -297,8 +296,7 @@ Display_Fstep( GtkEntry *entry, int fstep )
 {
   char str[4];
 
-  snprintf( str, 4, "%3d", fstep );
-  str[3] = '\0';
+  snprintf( str, sizeof(str), "%3d", fstep );
   gtk_entry_set_text( entry, str );
 }
 
@@ -390,7 +388,6 @@ Strlcpy( char *dest, const char *src, size_t n )
  * string is null terminated by copying only n-1 chars to leave room
  * for the terminating char. n would normally be the sizeof(dest)
  * string but copying will not go beyond the terminating null of src
-
  */
   void
 Strlcat( char *dest, const char *src, size_t n )
@@ -400,10 +397,11 @@ Strlcat( char *dest, const char *src, size_t n )
   int ids = 0; /* src  index */
 
   /* Find terminating null of dest */
-  while( (ch != '\0') )
+  while( (n > 0) && (ch != '\0') )
   {
 	idd++;
 	ch = dest[idd];
+	n--; /* Count remaining char's in dest */
   }
 
   /* Copy n-1 chars to leave room for terminating null */
@@ -430,12 +428,11 @@ Strlcat( char *dest, const char *src, size_t n )
  * Replaces strtod() to take into account the
  * locale-dependent decimal point character
  */
-double Strtod( const char *nptr, char **endptr )
+double Strtod( char *nptr, char **endptr )
 {
   int idx;
   size_t len;
   double d = 0.0;
-  char *s;
   static gboolean first_call = TRUE;
   static char dp = '.';
 
@@ -457,9 +454,8 @@ double Strtod( const char *nptr, char **endptr )
 	  break;
 
   /* If a decimal point character is found, replace */
-  s = (char *)nptr;
-  if( idx < (int)len ) s[idx] = dp;
-  d = strtod( s, endptr );
+  if( idx < (int)len ) nptr[idx] = dp;
+  d = strtod( (const char *)nptr, endptr );
 
   return( d );
 } /* End of Strtod() */
diff --git a/src/xnec2c.c b/src/xnec2c.c
index 1087371..bc8811d 100644
--- a/src/xnec2c.c
+++ b/src/xnec2c.c
@@ -168,7 +168,7 @@ Set_Interaction_Matrix( void )
   /* Memory allocation for symmetry array */
   smat.nop = netcx.neq/netcx.npeq;
   size_t mreq = (size_t)(smat.nop * smat.nop) * sizeof( complex double);
-  mem_realloc( (void *)&smat.ssx, mreq, "in xnec2c.c" );
+  mem_realloc( (void **)&smat.ssx, mreq, "in xnec2c.c" );
 
   /* irngf is not used (NGF function not implemented) */
   int iresrv = data.np2m * (data.np + 2 * data.mp);
@@ -625,8 +625,7 @@ Frequency_Loop( gpointer udata )
   if( isFlagSet(PLOT_ENABLED) )
   {
 	char txt[10];
-	snprintf( txt, 10, "%10.3f", (gdouble)calc_data.fmhz );
-	txt[9] = '\0';
+	snprintf( txt, sizeof(txt), "%10.3f", (gdouble)calc_data.fmhz );
 	gtk_entry_set_text( GTK_ENTRY(
 		  lookup_widget(freqplots_window, "freqplots_fmhz_entry")), txt );
   }
diff --git a/xnec2c.glade b/xnec2c.glade
index 9ad813b..042b65c 100644
--- a/xnec2c.glade
+++ b/xnec2c.glade
@@ -871,7 +871,7 @@ for New Frequency</property>
 	      <child>
 		<widget class="GtkDrawingArea" id="structure_drawingarea">
 		  <property name="width_request">681</property>
-		  <property name="height_request">769</property>
+		  <property name="height_request">481</property>
 		  <property name="visible">True</property>
 		  <property name="can_focus">True</property>
 		  <signal name="configure_event" handler="on_structure_drawingarea_configure_event" last_modification_time="Wed, 09 Feb 2005 06:20:26 GMT"/>
@@ -1040,7 +1040,7 @@ in Default Projection</property>
 		  <property name="numeric">True</property>
 		  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 		  <property name="snap_to_ticks">False</property>
-		  <property name="wrap">False</property>
+		  <property name="wrap">True</property>
 		  <property name="adjustment">45 -360 360 1 10 0</property>
 		  <signal name="value_changed" handler="on_main_rotate_spinbutton_value_changed" last_modification_time="Sat, 16 Apr 2005 07:33:16 GMT"/>
 		</widget>
@@ -1079,7 +1079,7 @@ to Plane of Screen</property>
 		  <property name="numeric">True</property>
 		  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 		  <property name="snap_to_ticks">False</property>
-		  <property name="wrap">False</property>
+		  <property name="wrap">True</property>
 		  <property name="adjustment">45 -180 180 1 10 0</property>
 		  <signal name="value_changed" handler="on_main_incline_spinbutton_value_changed" last_modification_time="Sat, 16 Apr 2005 07:32:55 GMT"/>
 		</widget>
@@ -2137,7 +2137,7 @@ to Plane of Screen</property>
 	      <child>
 		<widget class="GtkDrawingArea" id="freqplots_drawingarea">
 		  <property name="width_request">681</property>
-		  <property name="height_request">769</property>
+		  <property name="height_request">481</property>
 		  <property name="visible">True</property>
 		  <property name="can_focus">True</property>
 		  <property name="events">GDK_BUTTON_PRESS_MASK</property>
@@ -3108,7 +3108,7 @@ to Plane of Screen</property>
 	      <child>
 		<widget class="GtkDrawingArea" id="rdpattern_drawingarea">
 		  <property name="width_request">681</property>
-		  <property name="height_request">769</property>
+		  <property name="height_request">481</property>
 		  <property name="visible">True</property>
 		  <property name="can_focus">True</property>
 		  <signal name="configure_event" handler="on_rdpattern_drawingarea_configure_event" last_modification_time="Sat, 19 Mar 2005 14:26:17 GMT"/>
@@ -3263,7 +3263,7 @@ to Plane of Screen</property>
 		  <property name="numeric">True</property>
 		  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 		  <property name="snap_to_ticks">False</property>
-		  <property name="wrap">False</property>
+		  <property name="wrap">True</property>
 		  <property name="adjustment">45 -360 360 1 10 0</property>
 		  <signal name="value_changed" handler="on_rdpattern_rotate_spinbutton_value_changed" last_modification_time="Fri, 08 Jul 2005 18:41:18 GMT"/>
 		</widget>
@@ -3301,7 +3301,7 @@ to Plane of Screen</property>
 		  <property name="numeric">True</property>
 		  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 		  <property name="snap_to_ticks">False</property>
-		  <property name="wrap">False</property>
+		  <property name="wrap">True</property>
 		  <property name="adjustment">45 -180 180 1 10 0</property>
 		  <signal name="value_changed" handler="on_rdpattern_incline_spinbutton_value_changed" last_modification_time="Fri, 08 Jul 2005 18:42:24 GMT"/>
 		</widget>
@@ -4246,7 +4246,7 @@ to Plane of Screen</property>
 
 		  <child>
 		    <widget class="GtkTreeView" id="nec2_cmnt_treeview">
-		      <property name="height_request">170</property>
+		      <property name="height_request">70</property>
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
 		      <property name="headers_visible">True</property>
@@ -4548,7 +4548,7 @@ to Plane of Screen</property>
 
 		  <child>
 		    <widget class="GtkTreeView" id="nec2_geom_treeview">
-		      <property name="height_request">170</property>
+		      <property name="height_request">70</property>
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
 		      <property name="headers_visible">True</property>
@@ -4930,7 +4930,7 @@ to Plane of Screen</property>
 
 		  <child>
 		    <widget class="GtkTreeView" id="nec2_cmnd_treeview">
-		      <property name="height_request">170</property>
+		      <property name="height_request">70</property>
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
 		      <property name="headers_visible">True</property>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/xnec2c.git



More information about the pkg-hamradio-commits mailing list