Added new rasql functions and fixed type resolution bugs