Fixed bug in parsing relations