Fix #70, #77
Fix merge conflicts