Fixes for #120 #121 and #123