Fixed bug in rationalize