Fixed the __x() function and added tests