Merge and fix for #2 #3