Support for Database joins added.. Some other minor fixes