Added support for ~ and % modes. Close #10