fixes for bash4, new tests