Started implementing of Queries; few small fixes.