Copy match cases correctly. Closes #592