Fix merge issues

Fix some merge errors and tests