fixes for BZ issues 1015513 and 1015505