Fixes for klehmann issues

@ddumontatibm please review these changes