Replace faulty code which converts @..@ to {@..@} and add unit tests.