Fix merge bug; closes #1, #9, #15